PHP Help How To Redirect Web Pages Automatically Send

Mobile
feeds
Welcome Login | Register

PHP Help How To Redirect Web Pages Automatically Send
  Forums Index
      » PHP Forums
        » » PHP Help how to redirect web pages automatically send



PHP Help How To Redirect Web Pages Automatically Send
Post Description:
Post Tags: php, help, how, to, redirect, web, pages, automatically, send, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 479 Times Since Mon Dec 24, 2007 11:06 am Posted By hostman with 1 replies
PHP Help How To Redirect Web Pages Automatically Send
if you are intersted in knowing how to redirect pages automatically in php, i will show you today.

lets say i have a webform and after all the information is done, i dont want to put a link on the page that says click here to continue but instead just redirect the user.

there are three ways you can do this, you can do it with javascrip or html or php

today im gonna show you with php, why php, because its server side scripting..

lets say i want to send all my users back to the main page this is what i would use:




header('Location: http://www.wallpaperama.com');


this will automatically send the user to our main page

just make sure that you dont send any html or text to the user's browse or put any html code before this fucntion

the following would create an error:


<html>
<?php
/* This will give an error. Note the output
 * above, which is before the header() call */
header('Location: http://www.example.com/');
?>


header() is used to send a raw HTTP header. See the » HTTP/1.1 specification for more information on HTTP headers.

Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.

for more information about this, you can visit the php manual

header — Send a raw HTTP header


Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About PHP Help How To Redirect Web Pages Automatically Send




:: 1 :: Reply #63394 Reply By waqas On Sat Jul 26, 2008 8:47 am
ok
where r u
r u f9