Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 3 of 3 FirstFirst 1 2 3
Results 21 to 25 of 25
  1. #21
    Senior Member teal's Avatar
    Join Date
    Dec 2003
    Posts
    247
    Member #
    4319
    Quote Originally Posted by xarst
    For the time delay you can use this:
    PHP Code:
    header ("refresh: 5; banana.php"); 
    That will delay it in 5 seconds.
    Hope this was of help
    Perfect, that is exsactly what I need to know.
    I just want to add that with my server, although I don't know about all of them, it renders the code then moves but doesn't show the user anything.
    Whoth steps forth to mock the teal? Whom couldst say a color superior!

    Proclamith me, it cannot be done.

  2.  

  3. #22
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    Quote Originally Posted by james
    OK, so you can use header() still, but do your processing without echo()ing anything. This is a complex matter, but I think it's sorted out.
    You can echo() without any problem, just that the parser in place of echoing when it parses a expression, it echoes when the on_end_flush is found.

  4. #23
    Senior Member james's Avatar
    Join Date
    May 2003
    Location
    Melbourne, AUSTRALIA
    Posts
    364
    Member #
    1352
    True xarst. Can you write out a full example? Maybe 2 showing the use of header() and <meta>. You've done it now so that would be good.
    James H
    Home Page · Mars Page · www.fihsf1.net (formerly www·fihs·net)

  5. #24
    Senior Member
    Join Date
    Dec 2003
    Posts
    1,274
    Member #
    4362
    No problem, here is the example

    http://xtdesign.net/temp/test
    Here is the code of the PHP file:
    PHP Code:
    <?php
    ob_start
    ();

    echo(
    "$_POST[input1]");
    echo(
    "You are being redirected...");
    header ("refresh: 5; index.html"); 

    ob_end_flush();
    ?>

  6. #25
    Member macgruder's Avatar
    Join Date
    Apr 2004
    Location
    Japan
    Posts
    97
    Member #
    5524
    Quote Originally Posted by xarst
    No problem, here is the example

    http://xtdesign.net/temp/test
    Here is the code of the PHP file:
    PHP Code:
    <?php
    ob_start
    ();

    echo(
    "$_POST[input1]");
    echo(
    "You are being redirected...");
    header ("refresh: 5; index.html"); 

    ob_end_flush();
    ?>
    Unfortunately, the code that you have posted there is based on a misunderstanding:


    The above code is simply the same as
    PHP Code:
    <?php
    header 
    ("refresh: 5; index.html");
    echo(
    "$_POST[input1]"); 
    echo(
    "You are being redirected...");  ?>
    The output control functions don't actually allow you to send headers after text. They allow you to program it that way. With ob_start, the headers are still sent first. They have to be because that is the http protocol and the whole point of the headers is to let the browser know what is following.

    What the output control functions do is hold the browser output until the script is complete. Then the headers are sent, and then the 'held' output is sent. This is useful for example if your script encounters an error and you want to redirect upon that error happening. Unfortunately, without output buffering if you try to do that then you'll get the output already sent error as errors generally happen in the middle of a script. If you hold the output you can get around this problem, throw away the output.

    You don't need to use output buffering for a regular redirect. It's simply redundant.


Page 3 of 3 FirstFirst 1 2 3

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:19 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com