0

Hi,
I need help passing variables in php. I have an html page describing a job with an id number(jobdescription.html).

-when the user clicks on a submit button, I want to open another html page (jobsubmit.html) with a form and have the job id autofill into a form field named 'job_id'.

-further, when I hit submit on jobsubmit.html page, I want the job_id and all of the other fields the user fills out to enter into a table (this part, I know how to do).

I know how to use php to place data from a form into a database..BUT, My question is, how do I pass a variable (job_id) between the original job description page, to the jobsubmit.html page, and into a form field?? Is it even possible?

thanks in advance,
-l.

Edited by lwaterfo: n/a

3
Contributors
6
Replies
7
Views
7 Years
Discussion Span
Last Post by lwaterfo
0

Hi lwaterfo,

You will also need to save your pages as .php pages to be able to use PHP functions in them (jobsubmit.php instead of jobsubmit.html).


Zagga

0

thanks mazeroth and zagga! I'll try that out...

Edited by lwaterfo: n/a

0

hi,
well, I just tried it and it didn't work for me.
here is my php code:

<?php
echo $_REQUEST['job_id'];
?>

and here is my html code:

<form action="postid.php" method="POST">
<p>
  <input name="job_id" type="text" value="123" />
</p>
<p>
  <input name="Submit" type ="button" value="Submit" />
  </form>

got any ideas??

0

Hi again,

In the php code, try replacing ($_REQUEST) with ($_POST), and in the form replace (method="POST") with (method="post").


Hope this helps.
Zagga

0

thx zagga, but it still doesn't work! I am so frustrated..
Maybe its my browser..I am using safari version 5.0
I'll keep playing around with the code...

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.