Forum Moderators: coopster

Message Too Old, No Replies

passing speical values from one file to another file

         

suresheva31

6:57 pm on Sep 30, 2004 (gmt 0)

10+ Year Member



Heys, I have two files the first one is carrier.php, and the second is carrierevent.php.

On the carrier.php, I have to two different form entries like thise

PHP Code:
echo "<H4>Show All Carriers</H4>\n";
echo "<LI>Click the \"Show All Carriers\" button</LI>\n";
echo "<FORM ACTION='carrierevent.php' METHOD=POST>\n";
echo "<INPUT TYPE=SUBMIT VALUE='Show All Carriers'>\n";
echo "</FORM>\n";

Second form is with this.

PHP Code:
echo "<FORM ACTION='carrierevent.php' METHOD=POST>\n";;
echo "<TABLE>\n";
echo "<TR><TD>Carrier:</TD>\n";
echo "<INPUT TYPE=HIDDEN NAME='action' value = 'add_car' >\n";
echo "<TD><INPUT TYPE=TEXT NAME='entry' SIZE=60 MAXLENGTH=40></TD></TR>\n";
echo "<TR><TD>Endpoint:</TD>\n";
echo "<TD><INPUT TYPE=TEXT NAME='endpoint' SIZE=20 MAXLENGTH=10></TD></TR>\n";
echo "<TR><TD>PB Hostname:</TD>\n";
echo "<TD><INPUT TYPE=TEXT NAME='pbHostname' SIZE=40 MAXLENGTH=20></TD></TR>\n";
echo "</TABLE>\n";
echo "<P><INPUT TYPE=SUBMIT VALUE='Add Carrier'>\n";
echo "</FORM>\n";

What I want to do is I want to pass some speical values to carrierevet.php, ( I don't how to pass that value) so could control the excuting statements on the carrierevent.php using the if statements. Right now carrierevent.php, is getting excuted for both form codes. I I just want to know how to pass the value to carrierevet.php from carrier.php, so I could control the code excution lines.

Any hints or Ideas guys?

Thanks in Advance

coopster

10:49 pm on Sep 30, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You may want to have a quick read on the PHP site regarding forms. These two links should get you off the ground:

Dealing with Forms [php.net]
Variables from outside PHP: HTML Forms (GET and POST) [php.net]