|
-
Jul 29th, 2007, 05:57 PM
#1
Thread Starter
Addicted Member
PHP Keeping URL the same.
<FORM METHOD=POST ACTION="YAY.php" ACTION="index.php">
<CENTER><INPUT NAME="Register" VALUE="YAY" TYPE="submit"></CENTER>
</FORM>
when you click on yay the url turns from :
www.site.com/index.php
into www.site.com/YAY.php
how can i keep the url www.site.com/index.php BUT change the page into YAY.php
Thank you.
-
Jul 29th, 2007, 07:29 PM
#2
Re: PHP Keeping URL the same.
you are going to want to check to see if the page has been submited or not:
PHP Code:
if ($_POST['Register'] == "YAY") {
//WHAT YOU WANT HERE
}
but if you are looking for something like "index.php?page=mypage". then you can use a switch:
PHP Code:
switch ($_POST['page']) {
case "register":
include("register.php");
break;
default:
include("main.php");
break;
}
My usual boring signature: Something
-
Jul 30th, 2007, 10:00 AM
#3
Re: PHP Keeping URL the same.
You'd use header() for that but you're simply submitting a form to yay.php, which is why you can't "keep" the URL the same. If you must, then you can include that php file in the current php file, but make sure you remove the other bits.
-
Jul 31st, 2007, 01:00 PM
#4
Thread Starter
Addicted Member
Re: PHP Keeping URL the same.
i dont understand a single thing...
-
Jul 31st, 2007, 02:12 PM
#5
Re: PHP Keeping URL the same.
can you expand more on what you want? Both me and mendhak gave good clear examples.
My usual boring signature: Something
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
|
Click Here to Expand Forum to Full Width
|