Jump to content

help posting variable to page


MDanz

Recommended Posts

this is just part of my code

 

 while ($runrows = mysql_fetch_assoc($run)){
             
             $id = $runrows['id'];
             $name = $runrows['name'];             
             $hyperlink = $runrows['hyperlink'];
          [b]   $info = $runrows['info'];[/b]
             $rating = $runrows['rating'];
             $keywords =  $runrows['keywords'];




             echo "[b]<a href="">[/b]<img src='http://www.nbfsasfdf.com/Stacks/Strip.jpg'></a>";

 

 

i want on the click of the image, the hyperlink takes me to the page(info.php already made) displaying the contents of the variable $info.. how do i do this?

Link to comment
https://forums.phpfreaks.com/topic/172482-help-posting-variable-to-page/
Share on other sites

i'm getting this error

 

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/ustackc1/public_html/index.php on line 179

 

echo "<a href="info.php?data=<?php print urlencode(base64_encode($info)); ?>"><img src='http://www.gsgsgdk.com/Stacks/Strip.jpg'></a>";

 

<?php
print base64_decode($_GET['data']);

?>

 

 

Ok when you use $id in the url you then have to get the information with a query in info.php

 

<?php
$id = $_GET['id'];
$id = mysql_real_escape_string($id); ## always do this!!!!
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM `table` WHERE `id` = '$id'"));
echo $result['info'];
?>

for some reason on info.php i get a blank page

 

<a href='http://www.fsddf.com/info.php?id=$id' style='text-decoration: none';>

 

 

 

info.php

<?php
mysql_connect("localhost", "Master", "password");
mysql_select_db("db");
$id = $_GET['id'];
$id = mysql_real_escape_string($id); 
$result = mysql_fetch_assoc(mysql_query("SELECT * FROM `Stacks` WHERE `id` = '$id'"));
echo $result['info'];
?>

 

 

?? any idea

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.