-
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!
-
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.
-
 Originally Posted by donatello
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
-
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
-
 Originally Posted by tracknut
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..?
-
 Originally Posted by RahulSaini
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
-
 Originally Posted by tracknut
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)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
|
Bookmarks