472,959 Members | 1,605 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,959 software developers and data experts.

[SOLVED] Retrieve value from one phpfile to another.

sir,
i am starting working with php.i done some programs.but now i have one problem.i do a program like to retrieve the name and email from a phpfile to another.but i can't get.

this is the code "form.php"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>HTML Form</title>
</head>

<body>
<!-- Script 2.1 - form.html -->

<form action="handle_form.php" method="post">

<fieldset><legend>Enter your information in the form below:</legend>

<p><b>Name:</b><input type="text" name="name" size="20" maxlength="40"/></p>

<p><b>Email Address:</b><input type="text" name="email" size="40" maxlength="60"/></p>
<p><b>Gender:</b><input type="radio" name="gender" value="M"/>Male
<input type= "radio" name="gender" value="F"/>Female</p>
<p><b>Age:</b>
<select name="age">
<option value="0-30">under 30</option>
<option value="30-60">Between 30 and 60</option>
<option value="60+">Over 60</option>
</select></p>
<p><b>Comments:</b><textarea name="comments" rows="3" cols="50"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit Information"/></div>
</form>



</body>
</html>

and this is the code of "handle__form.php"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Form Feedback</title>
</head>

<body>
<?php #Script 2.2 - handleform.php


// Printing the appropriate message based on the event handle in the form.php

echo "Thankyou, <b>$name</b> for the following comments : <tt> $comments</tt><p> We will reply to you at <i>$email</i>.</p>";




?>
</body>
</html>

i got the output like this

Thankyou, for the following comments :

We will reply to you at .


no information about the name ,comment and email.
to get this what changes have to done ?

please give the details
by linto
thanks in advance
Oct 13 '06 #1
3 1972
ronverdonk
4,258 Expert 4TB
Since you are not new to this forum, you know that code should be posted within the appropriate php, html or code tags. See the Posting Guidelines or, when you are replying in the msg editor, the REPLY GUIDELINES at the right side of the screen.

You cannot expect members to wade throught a lot of unstructured code lines.

Ronald :cool:
Oct 13 '06 #2
In handle_post.php write the following code

$name=$_POST['name'];
$emal=$_POST['email'];
$gender=$_POST['gender'];
$age=$_POST['age'];
$comments=$_POST['comments'];

echo $name;

and now you can test whether the values are being posted or not
Oct 14 '06 #3
hello sir,
thanks for giving the solution.now i am working PHP nicely.thanks for all.
Oct 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas Paasch | last post by:
I've got somehow a little peculiar problem and can't seem to find the right solution so I could use a hand/hint or two. On toppings.php I have - among others: <a...
5
by: Clifford W. Racz | last post by:
Has anyone solved the issue of translating lists in Word 2003 (WordML) into xHTML? I have been trying to get the nested table code for my XSLT to work for a while now, with no way to get the...
2
by: epigram | last post by:
I'm responding to a button click event on an asp.net web form. I then need to retrieve the value from a TextBox control and I want to compare it against the control's previous value to see if it...
4
by: Jay | last post by:
2.0 asp.net app (precomiled in 2005, not updateable, dll's in bin and then merged to one dll)... web app calls a 1.1 (compiled in 2003) webservice initialization webmethod (works). Second call...
6
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a...
13
by: kev | last post by:
Hi all, I have created a database for equipments. I have a form to register the equipment meaning filling in all the particulars (ID, serial, type, location etc). I have two buttons at the end...
21
by: giandeo | last post by:
Hello Experts. Is it possible to retrieve the value from a populated pull down menu from a database and then use that value to access the same database to get the related fields. Example: ...
4
by: Jeff | last post by:
Hey ..NET 3.5 I'm trying to search a string to determine if the string contains </table>, but string.Contains don't find it. I've used WebRequest/WebReponse to retrieve the html from a...
2
by: puT3 | last post by:
I have Customer table where there is a field called Company Type which store corporate or private. I want to retrieve the value in the table so it is diplayed on classic asp file in radio button. Im...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.