/    Sign up×
Community /Pin to ProfileBookmark

How do i do this?

i started php, and i wrote this:

[code=php]<?php
$user=$_GET(‘username’);
echo (‘Hello $user . how are you?’);
?>[/code]

and saved it as recievefile.php

then i made this:

[code=php]<form action=”recievefile.php” method=”post”>
<input name=”text” type=”text” value=”name here” />
<input name=”Done” type=”submit” value=”Done!” />
</form>[/code]

and saved it as form.html

i dont even know what it does, all it does is open a download thing. i have PHP… does anyone know what the problem is?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@russellDec 01.2006 — 
  • 1. you need a web server (Apache) to process the PHP. Your browser won't parse PHP.


  • 2. You have method = post, but are trying to access the GET collection.


  • #2 doesnt matter until u take care of #1.
    Copy linkTweet thisAlerts:
    @H4X3RauthorDec 01.2006 — I have number 1, i fixed number 2. still doesnt work...
    Copy linkTweet thisAlerts:
    @russellDec 01.2006 — make method of form get. or instead of $user=$_GET('username'); do$user=$_POST('username'); also, u dont have a form field named "username" make your text box called "text" into name="username"
    Copy linkTweet thisAlerts:
    @H4X3RauthorDec 01.2006 — ok, i still fixed that, but it is still just prompting me to download the php file. i have the webserver and apache and php and everything and i fixed all the errors... help...
    Copy linkTweet thisAlerts:
    @hagakureDec 01.2006 — did you configure the apache server to parse .php files or is it still running under the default httpd file with no changes?

  • - hagakure
  • Copy linkTweet thisAlerts:
    @prophitDec 02.2006 — try something more like this and make sure php is working properly
    <i>
    </i>&lt;?php
    phpinfo();
    ?&gt;

    save that file as info.php.

    upload to your webserver and access it through your browser
    Copy linkTweet thisAlerts:
    @SheldonDec 02.2006 — also your PHP is incorrect. it should be like this (Note: I have used VB Code Tags)
    [code=php]
    <?php
    //recievefile.php

    $user = $_POST['text'];
    echo ("Hello " . $user . ". How are you?");
    ?>
    [/code]

    [code=php]
    <form action="recievefile.php" method="post">
    <input name="text" type="text" value="name here" />
    <input name="Done" type="submit" value="Done!" />
    </form>
    [/code]
    ×

    Success!

    Help @H4X3R spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...