Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6350013
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:43:49+00:00 2026-05-24T21:43:49+00:00

I understand how a PHP URL works – I think … but I’m having

  • 0

I understand how a PHP URL works – I think … but I’m having problems getting the actual value of the variable to be passed in the example below.

Example

Note: I am adding the below form into a data cell (as part of a table being read via PHP).

$currentrowid = 1;

echo '<td>
  <div class="editdelete">
    <form action="phpindex.php?page=edit&thisrow=<?php echo $currentrowid;?>" method="post">
      <input type="submit" value="Edit" >
    </form>
  </div>
</td>';

… Some other section of code to read the URL output by the form above:

$val = $_POST['thisrow']; 
echo "the value is: " .$val; //Outputs "$currentrowid"

So, as you can see the code returns the actual name of the variable being passed, NOT the value of the variable being passed.

Any ideas here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:43:49+00:00Added an answer on May 24, 2026 at 9:43 pm

    Since you are already within a PHP block, you should not wrap your variable within <?php ... ?>. This will give you an error.

    To make this work, you can choose 1 of 2 options:

    1) String Concatenation:

    echo '... <form action="phpindex.php?page=edit&thisrow='.$currentrowid.'" method="post"> ...';
    

    2) Wrap your string in " (double quotes) instead of ' (single quotes):

    echo "... <form action=\"phpindex.php?page=edit&thisrow=$currentrowid\" method=\"post\"> ...";
    

    Note that the second method forces you to escape all the double quotes inside of your string.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Tried examples from 'php.net' but don't understand what's the problem. Any suggestions? <?php $_SESSION['test']
I want to make Friendly URLs, but when I try my PHP code works
I don't understand this: I use the __autoload feature in php and this works:
I don't understand why data: 'txt=' + $('#nombre').value, doesn't work but data: 'txt=' +
I've been using xdebug to debug and understand code in php projects for a
I don't understand why this statement in PHP echos 'whaaa?' -- (0x0F | 0xF0)
I'm trying to understand this bit of code: in display.php: <html> ... <body> <table>
PHP has a number of opcode caches, which as i understand it are scripts
I'm running wget through php's shell_exec() How could I understand that wget got 404
I am implementing web services for a PHP application and am trying to understand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.