By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,372 Members | 1,229 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,372 IT Pros & Developers. It's quick & easy.

Undefined index

P: n/a
i have two file with jobapp.html calling jobapp_action.php
<HTML>
<!-- jobapp.html -->
<BODY>
<H1>Phop's Bicycles Job Application</H1>
<P>Are you looking for an exciting career in the world of cyclery?
Look no further!
</P>
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
</BODY>
</HTML>
<HTML>
<!-- jobapp_action.php -->
<BODY>
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>
</BODY>
</HTML>

but it return

Welcome
Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4
!
Jul 16 '05 #1
Share this Question
Share on Google+
2 Replies

P: n/a
You're using the 'post' method to post to frmJobApp, so you need to use
$_POST[applicant] rather than $_GET (or use method="get" rather than
method="post").

MK.

sky2070 wrote:
i have two file with jobapp.html calling jobapp_action.php
<HTML>
<!-- jobapp.html -->
<BODY>
<H1>Phop's Bicycles Job Application</H1>
<P>Are you looking for an exciting career in the world of cyclery?
Look no further!
</P>
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
</BODY>
</HTML>
<HTML>
<!-- jobapp_action.php -->
<BODY>
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>
</BODY>
</HTML>

but it return

Welcome
Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4
!


--
MeerKat

Jul 16 '05 #2

P: n/a
sk***********@hotmail.com (sky2070) schrieb:
[File 1]
<FORM NAME='frmJobApp' METHOD=post ACTION="jobapp_action.php">
Please enter your name:
<INPUT NAME="applicant" TYPE="text"><BR>
<INPUT NAME="enter" TYPE="submit" VALUE="Enter">
</FORM>
[File 2]
<P>Welcome <?php echo ($_GET[applicant]); ?>!</P>

Welcome Notice: Undefined index: applicant in c:\inetpub\wwwroot\jobapp_action.php on line 4 !


You're using POST, not GET. So the data should be in $_POST["applicant"]
(and not in $_GET["applicant"] or $_POST[applicant]).

Matthias
Jul 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.