How to Php redirect

I have a link on a site that I built that I would like to use a php redirect with. I know next to nothing about php, and it looks complex. Is there some kind of markup script or action I could use for this effect? What I want to accomplish is redirect the user that clicks on the site link to the page desired using a php redirect. This conceals an affiliate link in the status bar with its long url, and replaces it with a simpler page name url. Can this be done in Freeway? Thanks


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

update: I found a page action “timed redirect” this is an ok solution, but if there is a way to do it with php, then that would be great. I am looking to conceal the link from the status bar and from momentarily flashing on the browser bar. I understand this can be done with php but not with a javascript or metarefresh since these actions are handled by the users browser and php would be handled by my server. I found this bit of script online for a php header is there a way to add it in markup on the page? Also I tried to save a pages file extension to .php instead of .html and in preview it just shows a lot of code. Any help would be great! really floundering with this the last few hours.

php script I found

<?php header( 'Location: http://www.myaffiliatelink.com' ) ;?>

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Waylen

Php pages can’t be previewed locally unless you are running something like Mamp on your mac

Usually code like this can be added using Page>Html markup and probably paste your code in ‘Before html’

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you have a bunch of these that you want to be able to send off
with short URLs, you could do this:

<?php
//save this as go.php or something else short
$to = (isset($_GET['to'])) ? $_GET['to'] : null;
$urls=array(
	'http://example.com/some/long/path',
	'http://example.com/some/other/path',
	'http://example.com/somewhere/else'
);
if(array_key_exists($to,$urls){
	header('Location: ' . $urls[$to]);
	exit;
}else{
	header('Location: http://yoursite.com');
	exit;
}
?>

Now to access these, you simply create a manual link to go.php?to=0
to pick the first option in the array, go.php?to=2 to pick the
third option, etc.

When constructing the array, make sure you put a comma after each
option EXCEPT the last one. It should look like this: one,two,three
if you made it all on one line.

Make this file with a good plain-text editor, like TextMate or BBEdit
or TextWrangler. Don’t use Word or any other “rich” editor, unless
you like error messages. Upload it to your web folder on your site.
Now you don’t have to make your Freeway pages into php pages, you
just need this one “hub” page to do the redirecting for you.

Walter

On Apr 30, 2008, at 6:27 PM, Waylen wrote:

update: I found a page action “timed redirect” this is an ok
solution, but if there is a way to do it with php, then that would
be great. I am looking to conceal the link from the status bar and
from momentarily flashing on the browser bar. I understand this
can be done with php but not with a javascript or metarefresh since
these actions are handled by the users browser and php would be
handled by my server. I found this bit of script online for a php
header is there a way to add it in markup on the page? Also I tried
to save a pages file extension to .php instead of .html and in
preview it just shows a lot of code. Any help would be great!
really floundering with this the last few hours.

php script I found

<?php header( 'Location: http://www.myaffiliatelink.com' ) ;?>

freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

If you’re looking at this on the Web, the code example is being messed up by the automatic formatting. In the big block of PHP above, the second header() should be directing to a plain URL, not to a clickable link. It should read like this – minus the extra space after // used to keep the auto-link from kicking in:

header('Location: http:// yoursite.com');

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options