Jul 7, 2008

header() - redirection

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

free web hosting

header() - redirection

LuciferStar
CODE
<?php
if($_REQUEST['name']==NULL)
{
  header("Location:?name=Guest");
}
else
{
?>
<html>
 <head>
 <title>Welcome</title>
 </head>
 <body bgcolor=black>
 <?php
    echo "<font color=gray><b>Hello,  ";
    echo $_REQUEST['name']."</b><p>";
 ?><pre>
<?php
    for($i=0;$i<10;$i++)
    {
       for($j=0;$j<10;$j++)
       {
          echo ($i*$j)."\t";
       }
       echo "\r\n\r\n";
    }
?><pre>
 </body>
</html>
<?php
}
?>

 

 

 


Reply

LuciferStar
not only redirection
smile.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics

Keywords : header redirection

  1. [php] Header Function - (2)
  2. Header Redirect Errors - (5)
    Hi, I am using the header function to redirect after the processing of the form. I have to specify
    a internal link using '#link'. This works in Firefox and opera. But in Internet Explorer
    internal linking when done from a redirect is not working for somewhat reasons. e.g.
    header("Location: http://www.example.com/index.php#link"); this works in Firefox and Opera but
    not in Internet Explorer . IE just accepts 'http://www.example.com/index.php' instead of
    http://www.example.com/index.php#link Please help me if you know anything about this. Well ther...
  3. Email Header Inject Test - (0)
    So I'm trying to write a script to check if someone is trying to do a header inject using my web
    based email form. The problem is that, regardless of the content, it is being tagged as hijacked.
    The following is the relevant part of my code: CODE $ip=$_POST['ip'];
            $httpref=$_POST['httpref'];
            $httpagent=$_POST['httpagent'];
            $visitor=$_POST['visitor'];
            $visitormail=$_POST['visitormail'];         $s...
  4. Wap Redirection - Usefull code that all wap site owners should use! (12)
    Use this code to redirect pc users from your wap site to web site: include above page header this
    code: CODE <?php $mywebsite = "forum/index.php"; $browser = explode
    ('/', $HTTP_USER_AGENT); if($browser[0]=="IE"){
    header ('Location: $mywebsite');} ?> ...
  5. Php Header Problem - i always got header problem (9)
    i really hate the header function it always get an error saying ( cannot ------- headers already
    sent by----- ) and here's my error: Warning: session_start(): Cannot send session cookie -
    headers already sent by (output started at /home/adly3000/public_html/Mail/index.php:5) in
    /home/adly3000/public_html/Mail/index.php on line 81 Warning: session_start(): Cannot send session
    cache limiter - headers already sent (output started at /home/adly3000/public_html/Mail/index.php:5)
    in /home/adly3000/public_html/Mail/index.php on line 81 Warning: Cannot modify header ...
  6. php header() function help needed - automatic re-direct (4)
    hey ppl, u seem to have real gud knowledge about php, i just wanted a little help...i designed this
    website, but i want that if i click on certain page, it should open for some few seconds and then
    browser should automatically redirect me to some other page....i tried this with header() function
    but i couldnt do the wait n redirect part, ... so somebody plz help.... -thanx in advance!...
  7. Need Help With The Header() Function - I am redirecting from my old site (2)
    Over a month ago, I bought a domain name for my site, but my site is still not indexed. I did
    everything needed to get indexed, but I forgot one thing: The old site had exactly the same content
    as the new one. So I had duplicate content. Therefore, I want my old site to redirect the user to
    the new site with this script: CODE <?php header("Location:
    http://www.global-rs.com" . $_SERVER['REQUEST_URI']); exit; ?>
    global-rs.com is my new URL. However, on my old site, which I will be placing this code on, there
    i...
  8. Spacer Below Header :s - (3)
    Below my header, which includes the logo and a horizontal menu bar, there is an empty space of the
    size of a linebreak. I'm completely new to PHP... My header is an include tag , and where the
    top.htm site should end, there is a linebreak that I can't remove... Is there a way to remove
    it? Also, it happens in my vertical menu too, and below the footer, but it doesn't really
    affect the design....
  9. Url Redirection - redirect a page web to another page (7)
    Hi Is there some functions in php to redirect a page web to another page. thanks...
  10. Question On Header() Function - (3)
    Hello I have a question regarding the header(location:http:// etc) function. I have a php document
    that looks similar to the followiing //now some code specific to this page only if blah blah {
    do some stuff } else { header("location : http://some_page.php"); } include ("./bottom.php");
    //this file contains loads of html and is resident on all pages in the site IT HAS TO BE HERE -----
    my question is this, how can i redirect to a new page using the header() function in the middle of
    a file like this ie when i have already passed a load of html and other stuf...



Looking for header, redirection

Searching Video's for header, redirection
advertisement



header() - redirection



 

 

 

 

ADD REPLY / Got an Opinion! Remove these ADs! RAPID SEARCH! Free Web Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE