The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php problem

Discussion in 'General Discussion' started by foxpiles, Nov 28, 2005.

  1. foxpiles

    foxpiles Member

    Joined:
    Nov 23, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    i just install cpanel and having a problem with using php.

    all command in php is working just fine, but when i use post method to send variable to php page, it's just contain nothing at all.

    i test it with this easy script

    http://inlie.com/index.html

    HTML:
    <form name="form1" method="post" action="index2.php">
      <label>
      <input type="text" name="word">
      </label>
      <p>
        <label>
        <input type="submit" name="Submit" value="Submit" />
        </label>
      </p>
    </form>
    and this is index2.php
    PHP:
    <?
    echo 
    "test php<br>";
    echo 
    $word;
    ?>
    when i hit the submit in index.html page, the index2.php page should show the word enter in the form, but it's wasn't, it's just print text 'test php' out

    i don't know much about setting up php, so...please help

    thanks in advance :)


    edit to say that i've test the script on another server and it workinh just fine, i also test other scripts on my server and it appear to have the same problem
     
  2. foxpiles

    foxpiles Member

    Joined:
    Nov 23, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    oh...now i know, if i use $_GET['viable name']; it's work
    but how can i just use $viable name ?

    ps. my register_globle status is on, but still i can't use it, anyone?

    thanks
     
  3. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    Add this code:
    PHP:
    if(!empty($_GET)) extract($_GET); 
    Call the variable like you normally would.
     
  4. foxpiles

    foxpiles Member

    Joined:
    Nov 23, 2005
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    solved thanks!
     
Loading...

Share This Page