Click here to Skip to main content
15,910,661 members
Please Sign up or sign in to vote.
3.50/5 (2 votes)
See more:
I used following code to write a php page:
XML
<html>
<!-- jobapp_action.php -->
    <body>
    <P>Welcome <?php $_GET['applicant']; ?>!</P>
    </body>
</html>

Next, by pressing Enter button in the following HTML page and entering "Shah Rukh":
XML
OK, OK I used the method you specified in an HTML page. Here it is:
<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 furthur!
        </p>
        <form NAME='frmJobApp' METHOD="get" ACTION="jobapp_action.php">
            Please enter your name:
            <INPUT NAME="applicant" type="text"><br />
            <INPUT NAME="enter" type="submit" value="Enter"><br />
        </form>
    </body>
<HTML>

I receive following page:
Welcome !
Instead of expected this one:
Welcome Shah Rukh!
I cannot understand why $_GET is not working as I am very new to php programming. Please help me out.
Thanks in advance.
Posted
Updated 10-May-11 19:37pm
v3

You should echo it:
XML
<html>
<!-- jobapp_action.php -->
    <body>
    <P>Welcome <?php echo($_GET['applicant']); ?>!</P>
    </body>
</html>


HTH...
 
Share this answer
 
v2
Comments
Shah Rukh Qasim 11-May-11 2:46am    
Thanx. It worked!
Joan M 11-May-11 3:05am    
You are welcome... As you can see SAKryukov was right... improving questions help us to give you better answers... This is a clear example: it was something fairly easy to spot, but we were not capable to do it as we were not able to see it... anyway... I'm glad it worked for you...
Sergey Alexandrovich Kryukov 11-May-11 15:13pm    
Joan, thanks for crediting me. You're absolutely right.
Get my 5 for finally spotting the bug.
--SA
Joan M 11-May-11 18:02pm    
You don't need credit, at least not from me... you are doing a monstruous job here... Thank you for the 5! ;)
Sergey Alexandrovich Kryukov 11-May-11 18:57pm    
My pleasure.
--SA
Why do you think it should work? The PHP function $_GET assumes that this page is the target page of HTML form using the HTTP method "GET". Do you have this form? Why didn't you show its code?

Please note: for a developer, there is not such thing as "not working". If you're asking a question, you need to submit a precise problem report. Provide a full relevant code (create a smallest sample specially do show your problem), steps to reproduce, what exactly is observer, diagnostic data, etc.

—SA
 
Share this answer
 
Comments
Shah Rukh Qasim 11-May-11 1:39am    
OK, OK, I have improved my question. I have written the whole HTML page. Can you help me out now?
Sergey Alexandrovich Kryukov 11-May-11 15:11pm    
Yes. It all looks correct -- almost. As I can see, Joan already spotted the bug.
Is it OK now?

If so, I think you should better formally accept my answer as well, as it helped to report the problem and spot it.
Don't you think so?

Thank you.
--SA
pls provide me ur email id....i need to contact u, its urgent regarding channel assignment
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900