Jump to content

[SOLVED] Really quick question


tfburges

Recommended Posts

What's wrong with this?

 

A field has a hyperlink beside it with the URL linked to the field description so that the field description and any matching data within the database pertaining to that field can be queried.

 

Example URL (all variables exist):

saac.php?fnvs=",$selected_formx_v,"&qf=",$dfcdi,"

 

Then in saac.php...

$qf = $_GET['qf'];
$qpf = $_POST[$qf];
echo $qpf;

 

$qf works fine but $qpf doesn't.  It must be a syntax error or something special that I'm not aware of.

 

I've also tried $qpf = $_POST['$qf']; and other ways to put single quotes around $qf.

Link to comment
https://forums.phpfreaks.com/topic/114859-solved-really-quick-question/
Share on other sites

With

 

$qf = $_GET['qf'];

$qpf = $_POST[$qf];

echo $qpf;

 

it looks like you are trying to put the variable $gf that you have recieved via the url into a new variable $gpf... if so

 

$qpf = $qf;

 

will work. if your trying to then send the variable $gpf somewhere else via post I would put it into a hidden input type.

 

I may have totally misunderstood what you are doing ;D

post all your code

$_POST only works when you post the infomation, i.e. you submit the form. So unless I misread, you're clicking on a hyperlink to get a description, but not submitting the form and that's where the problem is.

 

OHHHHHHHHHH LOLOLOLOLOL WOW I CAN'T BELIEVE I OVERLOOKED THAT!

 

THANKS!!1!11ONE

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.