Jul 7, 2008

Header Redirect Errors

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

free web hosting

Header Redirect Errors

electron
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 there might be a issue in Internet Explorer 7 and i dont have Internet Explorer 6.
If you know of such bugs in Internet Explorer 7 or any such bugs in PHP let me know.

Thanks and have a good day.

Reply

shadowx
that's strange, it probably is an error in IE7 if it works in other browsers, if theres any way of putinng the code online i, or someone else can test it in IE6, FF opera etc as well and see if we get errors too. You using the #link to focus the browser on a specific part of the page right? in which case i would definately say its a browser based problem not a code based one.

Reply

biscuitrat
You were doing this, right?:

CODE
<a href="http://www.example.com#link">This is anchor text</a>
<a id(or name)="link"></a> This is the text at the beginning of a paragraph


Please post your code so we can check it!

Reply

detportal
Isn't there something you can do on the cPanel, assuming you are hosted on trap17?
They have something you can do to manage redirects, though I'm not sure if you can configure it to activate after you process a form.
And I agree with the previous poster, you should paste your code here so we can have a look at it.

Reply

Spectre
This has nothing to do with cPanel or with linking. And he did post his code.

I've never encountered this problem as such, electron, but when I did a little experimenting with it I got some interesting results. Some of the time it would work fine for me and do exactly what it was supposed to - but other times there was some unusual behavior by the browser, including displaying the incorrect URL in the address box, displaying the correct URL but without the fragment, and displaying the fragment but not scrolling to it. As you said it works fine in Opera and FireFox, so perhaps it's connected to a bug in IE7 that hasn't been ironed out yet?

Reply

coby


I've also encountered this problem as such, electron, but when I did a little experimenting with it I got some interesting results. Some of the time it would work fine for me and do exactly what it was supposed to - but other times there was some unusual behavior by the browser, including displaying the incorrect URL in the address box, displaying the correct URL but without the fragment, and displaying the fragment but not scrolling to it. As you said it works fine in Opera and FireFox,

please use this code in your php code, it's worked fine with me

echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"1; url=".$PHP_SELF."#link\">";

coby

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:

Recent Queries:-
  1. process_login.php "blank page" - 129.01 hr back.
  2. http_redirect $_post - 225.67 hr back.
Similar Topics

Keywords : header, redirect, errors

  1. Fopen Errors :(
    grrr, i'm angry :( (6)
  2. Http_redirect() [resolved]
    (4)
    i am writing a script, and whenever i use this line CODE
    http_redirect("process.cgi"); i get a call to undefined function error for
    http_redirect(). maybe i am misunderstanding what this function is used for..... when i call it, it
    will take the user to the page indicated... in my case "process.cgi" that was my interpretation of
    it from the page in the php manual. i am running xampp for windows and php 5.2.1....
  3. New Found Php Coding Errors
    I always thought these worked, but suddenly they no longer do?! (5)
    Hi i'm dan from new zealand, right next to my home land australia. I have been writing php
    scripts for two years now and just recently none of them have been working. Please help me out as
    best as you can, i'm sure it is only something simple. CODE ----------------Form
    1-------------------------- <?php // ---- Customized form script for the HBRC---------------
    // Receiving variables ----------------------------------- @$fn =
    addslashes($_POST['fn']); @$ln =
    addslashes($_POST['ln']); @....
  4. [php] Header Function
    (2)
    Header function Greetings we are going to use the header() funtion to redirect start making a
    file called page.php at the top of the file add CODE <?php ?> Example 1 After
    CODE header('Location: http://www.trap17.com'); the LOCATION means
    where you want it to go. Example 2 you also can define a file that you want to redirect to After
    CODE header('Location: index.php'); Example 3 you also can add a timer to
    it /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0" alt=....
  5. 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....
  6. Script Not Working :s
    mysql errors (5)
    process_login.php: Process the login. $host = "localhost";// the host that u are connecting
    $username = "root";// user name $password = ""; // passworld $basedatos =
    "forum"; //Dont change this1. $db = mysql_connect($host, $username, $password);
    mysql_select_db($basedatos, $db); $user= $_REQUEST ; $pass=
    md5($_REQUEST ); $query1= "SELECT * FROM smf_members WHERE
    memberName='$user'"; $mkquery= mysql_query($query1,$db); $row1=
    mysql_fetch_assoc($mkqu....
  7. 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 ....
  8. 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!....
  9. Problem With Page Redirect
    Help me out with this problem... (7)
    hey ppl, i just wanted a little help...i designed this website, but i want that if i click on
    certain link, it should open new page for 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! Thanks Avalon, topic changed. ....
  10. 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....
  11. .htaccess Redirect Question
    redirect ALL traffic to another domain (6)
    I want to redirect all my traffic from one site to another domain name. Is this possible, and if so,
    would I do something like this: .htaccess code: CODE redirect 302 /
    http://www.mynewdomain.com Thanks!....
  12. 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.....
  13. Getting Errors On A Script
    need to know what im doing wrong (3)
    ok please help me!! im trying to get this tournamt/leage ladder script working, its with php
    but i think i put all the files in the right palces but i keep getting this error .... CODE
    Warning: main(modules/NukeLadder/admin/index.php): failed to open stream: No
    such file or directory in /home/berkolli/public_html/DjLuki/admin/case/case.php on line 77
    Warning: main(modules/NukeLadder/admin/index.php): failed to open stream: No
    such file or directory in /home/berkolli/public_html/DjLuki/admin/case/case.php on line 77 W....
  14. Problem With Headers
    setcookie errors (5)
    I'm having troubles with my authentication function, if the the users uses wrong login info, it
    works like a charm, but it gives me errors when i set the cookies, so help would be appreciated...
    CODE Function auth(){ $user=$_POST['username'];
    $pass=$_POST['password']; $qry="SELECT id from Solarity where
    username='$user' and password='$pass'";
    $result=mysql_query($qry) or die("A problem occured during authentication
    process"); $....
  15. 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....
  16. Getting Rid Of Errors
    (4)
    Hi Is it ok to use error-reporting(0) locally in a snippet of code that spits an undefined variable
    error? I found that fix and was wondering what does everybody do about error messages that keep
    poping up. Thanks Patrick....
  17. 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....
  18. Mysql Errors
    cant find whats wrong :( (3)
    I am working on my guestbook, better to say I am transfuring it from old to new site, but I got some
    errors now I did not had at my old hoster and I cannot figure out whats wrong: CODE
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in
    /home/pbrugge/public_html/guest.php on line 104 Warning: mysql_fetch_array():
    supplied argument is not a valid MySQL result resource in /home/pbrugge/public_html/guest.php on
    line 110 This is the complete relevant code perhaps I overlooked something but I keep ove....
  19. header()
    redirection (1)
    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++&#....

    1. Looking for header, redirect, errors

Searching Video's for header, redirect, errors
advertisement



Header Redirect Errors



 

 

 

 

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