Jump to content

How Do You Make A Link


TKW22
 Share

Recommended Posts

ok i think i got this right but not sure.you uses headers to go to a different page.so can you use that to make a url come up like this

http://domain.com?t=22

not this

http://domain.com/index.php

?and if so how.iv tryed to do it already just cant get it to go.

Link to comment
Share on other sites

Just know that when you use headers, it's not going to always be sending a user to a new page, though it might be what you do most of the time.
http://domain.com/?page=22

something like that or switch the url as soon as they go on it

Link to comment
Share on other sites

The address http://domain.com/?page=22 is basically sending a user to the main index page of the domain and is passing the varaiable "page" with a value of "22"If you don't want to go to the index page then you can use any address like http://domain.com/anotherpage.php. It doesnt make any difference to the header which address you use as long as it is valid.Their are other options to go to another page but it depends on what page you are coming from and if you need to pass any data between pages.

Link to comment
Share on other sites

People can really bookmark any page, you can't really stop that. If you have something that your page is doing then you either need to have a way to detect when to do that or when not to do it, or after it's done you redirect to another page that shows a summary of what happened. Even if they bookmark the summary page it won't re-process anything.

Link to comment
Share on other sites

Hmm... I agree with @Justsomeguy that you can bookmark any page really and that index.php or any other files named index do now show up, as you can only see the domain http://www.domain.com/ now you can always make direcotrys inside your server and put an index file inside which will only show the URL like this http://www.domain.com/somethingIn any case here is the script...

<?phpif($_REQUEST['do'] == "account"){//Do some code here such as echo some source here or do something of that sort}elseif($_REQUEST['do'] == "shop){//Do something else here usinfg source or echo classes and stuff like that}else{//If its neither of those then do something here }?>

Now if they go to http://www.domain.com/?do=shop this will trigger the PHP to show the contence of SHOP so basicly you can put full website layout where it says //Do some code here... bla bla bla...If you want the extenction to be different then what I have which is ['do'] just replace that with anything you want like ['act'], ['action'], ['p'], ['page'].... ect...Hope that helps ^^

Link to comment
Share on other sites

Hmm... I agree with @Justsomeguy that you can bookmark any page really and that index.php or any other files named index do now show up, as you can only see the domain http://www.domain.com/ now you can always make direcotrys inside your server and put an index file inside which will only show the URL like this http://www.domain.com/somethingIn any case here is the script...
<?phpif($_REQUEST['do'] == "account"){//Do some code here such as echo some source here or do something of that sort}elseif($_REQUEST['do'] == "shop){//Do something else here usinfg source or echo classes and stuff like that}else{//If its neither of those then do something here }?>

Now if they go to http://www.domain.com/?do=shop this will trigger the PHP to show the contence of SHOP so basicly you can put full website layout where it says //Do some code here... bla bla bla...If you want the extenction to be different then what I have which is ['do'] just replace that with anything you want like ['act'], ['action'], ['p'], ['page'].... ect...Hope that helps ^^

thanks for the info sorry for wasting you time.I should of looked first.
Link to comment
Share on other sites

i have one more ?.can you change this

http://somedomain.com/login/index.php

to this?

http://somedomain.com/?login=1

sorry for double post didn't see i post the last post

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...