html/php experts come!

Discussion in 'HTML & Website Design' started by dopex, Apr 12, 2008.

  1. #1
    basically i want to make a simple page and

    it has 2 field boxes, value 1 and value 2. then i went a submit button that opens a page going to

    www[.]website[.]com/value1=x&value2=x

    how could i go about making something like that.

    thanks in advance. :D
     
    dopex, Apr 12, 2008 IP
  2. VoYdE

    VoYdE Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    <form action="linktothepage.php" method="get">
    <input type="text" name="value1" />
    <input type="text" name="value2" />
    <input type="submit" />
    </form>
    
    Code (markup):
    Php is not needed until you want to get the values back to the page

    
    <?
    $value1 = $_GET[value1];
    $value2 = $_GET[value2];
    
    echo $value1.$value2;
    ?>
    
    Code (markup):
    I could more in-depth if tell me the page names
     
    VoYdE, Apr 12, 2008 IP
  3. dopex

    dopex Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    actually, now that i think about it, i'll only need one value...
     
    dopex, Apr 12, 2008 IP
  4. VoYdE

    VoYdE Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    <?
    echo $value1;
    ?>

    I dont follow.
     
    VoYdE, Apr 12, 2008 IP
  5. dopex

    dopex Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    alright, this is all i really need. i got it figured out but all i need is this.

    $variable = $_GET[variable];
    header( 'Location: http://google.com/$variable' ) ;

    how do i correctly put variable, say index.html in there.
    cause when i do it this way, it literally goes to google.com/$variable
     
    dopex, Apr 12, 2008 IP
  6. VoYdE

    VoYdE Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    VoYdE, Apr 12, 2008 IP
  7. dopex

    dopex Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    what i want is a way to go to .. site.com/page=1&author=1&randomcode


    i tried your example

    header( 'Location: http://google.com/'.$variable ) ;

    like so

    header( 'Location: http://google.com/page='.$variable '&blahblahsomerandomcodehere&author='.$variable '&randomcode' ) ;

    but.. that didn't work.
     
    dopex, Apr 13, 2008 IP
  8. dopex

    dopex Peon

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Bring
    Up
    My
    Post
     
    dopex, Apr 14, 2008 IP
  9. VoYdE

    VoYdE Peon

    Messages:
    95
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    I lost you, you keep changing what your trying to do!

    Last effort
    $page = $_GET[page];
    $author= $_GET[author];
    $random= $_GET[random];

    header( 'Location: http://google.com/?page='.$page.'&author='.$author.'&randomcode='.$random.' ) ;
     
    VoYdE, Apr 15, 2008 IP