Jump to content

url redirect


scottybwoy

Recommended Posts

Simple question,

 

How do I send a string to the url.  Or just redirect to another page, withou having to install http pecl

1: HTML meta refresh tag

<meta http-equiv="refresh" content="seconds;url=url here">

2: Javascript header change script

<script type="text/javascript"> <!-- window.location = "URL here" //--> </script>

3: PHP's header function.

header("Location: $url");

Link to comment
Share on other sites

Can this be done without javascript, as I already have it working with javascript, but want to replace it with pure php 4 so that users without java can use the function.  I'm using a select menu to jump to another page, by the way.

 

Just for the record, Javascript is not the same as Java. They are two entirely different languages.

 

Seeing as you are using a select menu there is no other way than using Javascript. This cannot be accomplished with PHP code.

Link to comment
Share on other sites

Erm, thanks for all your info.  Yeah I know java is seperate from JS I'm just lazy.

 

My Select menu is like this :

<form action="$url/php/select_url.php" method="post">
<select id='menu' onchange='submit()' name='menu'>
	<option>Jump to Product</option>
</select>
</form>

 

And papface's code works nicely.  I use a seperate php method to populate the select menu.  So as this one uses the onchange submit() <- I take it that is a javascript function and would not work, however if I use a noscript and include a submit button it will just have a button for the people not enabling JS correct?

 

If so we have a fully functional Submit menu without using any javascript, it IS possible!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.