www.webdeveloper.com
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2012
    Location
    Delhi
    Posts
    19

    How to Do this, Please help me - http://domain.com/index.php?id=1&page=1

    Hello friends....
    I am confused how to do this or make something like this
    http://domain.com/index.php?id=1&page=1

    I have site which have Mobile SMS, iwant to create this
    i know only http://domain.com/index.php?id=1 but for &page=1
    PHP Code:
    <?php
    $id 
    $_GET['id'];
    if (
    $action == '1')
     {
     echo 
    'This is Page 1';
     }
     else
     {
     echo 
    'Wrong id or Page';
     }
    ?>
    i didn't know... how to enter code for &page=1
    Some help me please..
    it will be very helpful for me...
    Thanks!

  2. #2
    Join Date
    Jun 2008
    Location
    Europe
    Posts
    1,040
    PHP Code:
    <form method="get" action="">
    <input type="text" name="page" />
    <input type="submit" />
    </form>
    <?php 
    $page 
    $_GET['page'];

    if (
    $page == '1'

    echo 
    'This is Page 1'

    else 

    echo 
    'Wrong id or Page. This is page '.$page"

    ?>
    Not sure if that's what you're after, or if you are trying to parse the current URL without going via a form and GET...
    http://webcheatsheet.com/php/get_current_page_url.php
    Last edited by donatello; 08-08-2012 at 12:32 PM.

  3. #3
    Join Date
    Jul 2012
    Location
    Delhi
    Posts
    19
    Quote Originally Posted by donatello View Post
    PHP Code:
    <form method="get" action="">
    <input type="text" name="page" />
    <input type="submit" />
    </form>
    <?php 
    $page 
    $_GET['page'];

    if (
    $page == '1'

    echo 
    'This is Page 1'

    else 

    echo 
    'Wrong id or Page. This is page '.$page"

    ?>
    Not sure if that's what you're after, or if you are trying to parse the current URL without going via a form and GET...
    http://webcheatsheet.com/php/get_current_page_url.php

    Thanks but i am still confused, we can't run two $_GET as i think... need more explnatio plz

  4. #4
    Join Date
    Aug 2006
    Posts
    1,833
    Could be there's just a communication problem, I may only add to it...
    PHP Code:
    <?php
    $page 
    $_GET['page']; 
    $id $_GET['id'];

    if (
    $id == '1' && $page == '1'//do something
    else
    ...
    That is all legal code, and how you'd hand two parameters.

    Dave

  5. #5
    Join Date
    Jul 2012
    Location
    Delhi
    Posts
    19
    Quote Originally Posted by tracknut View Post
    Could be there's just a communication problem, I may only add to it...
    PHP Code:
    <?php
    $page 
    $_GET['page']; 
    $id $_GET['id'];

    if (
    $id == '1' && $page == '1'//do something
    else
    ...
    That is all legal code, and how you'd hand two parameters.

    Dave
    Thanks!
    I don't know how to hand two parameters... can you tell me if you know... or this code will be work..?

  6. #6
    Join Date
    Aug 2006
    Posts
    1,833
    Quote Originally Posted by RahulSaini View Post
    Thanks!
    I don't know how to hand two parameters... can you tell me if you know... or this code will be work..?
    I think the code above does what you want... if you want to collect the two parameters page and id from the url.

    Dave

  7. #7
    Join Date
    Jul 2012
    Location
    Delhi
    Posts
    19
    Quote Originally Posted by tracknut View Post
    I think the code above does what you want... if you want to collect the two parameters page and id from the url.

    Dave
    Thank You dear....
    i will be try this after i reached into my home.., hehe

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



Recent Articles