Jump to content

posting a variable to another page


MDanz

Recommended Posts

I have a search engine.. when the results come... i want to post the $name variable from the result to reply.php

 

this is how i show results

 

echo '<table '.$margin.'>';
         
          while ($runrows = mysql_fetch_assoc($run)){
             
             $id = $runrows['id'];
             $name = $runrows['name'];
             $image = $runrows['image'];
             $hyperlink = $runrows['hyperlink'];
             $currency = $runrows['currency'];
             $info = $runrows['info'];
             $type = $runrows['type'];
             $rating = $runrows['rating'];
             $keywords =  $runrows['keywords'];



             echo '<td><tr>';
             echo "<a href='$hyperlink'><img src='http://www.u-stack.com/Stack.jpg'></a>";
             echo "</tr><font color=white><strong>  $name - $info - $rating <a href='rate.php?id=$id'><img src='http://www.u-stack.com/rate.jpg'></a></font>

             <a href='http://www.u-stack.com/reply.php?reply=$name&submit=reply' style='text-decoration: none'; >Reply</a>
             </center><br><br><hr size='1'></strong></td>";

          }
          echo '</table>';

 

 

i want to post the $name variable to reply.php

 

 

so in the reply.php textfield, i can set the value as $name and the name of the result appears in the textfield.

 

Link to comment
https://forums.phpfreaks.com/topic/171507-posting-a-variable-to-another-page/
Share on other sites

if you are going to reply.php?name=something

 

 

and you print($_GET['name']);

 

it should print "something" on the page (the value of 'name')

 

if you want it to be placed in the textarea in reply.php, you must print($_GET['name']); between the <textarea></textarea> tags like:

 

<textarea>

print($_GET['name']);

</textarea>

 

if it is not outputting the value of 'name', then the value of 'name' is not being passed to reply.php in the first place.

hi thx for help..

 

returned the value '1' for some reason

 

on search.php this is how i use $name & reply.php...

<a href='http://www.example.com/reply.php?reply=$name&submit=reply'>Reply</a>

 

so the reply is associated with the name of the result from the search.

 

all the results have different names, so when a user replies, it uses the name(result) like a thread title.

 

and in reply.php

this is the text field i want the $name value in. I tried it this way originally then your way.

 

<input type='text' name='keywords' value='$name' <br>

 

 

 

 

 

 

 

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.