Computers |
|
| | #2 (permalink) |
| True Techie | You don't need PHP to do it. This is a valid HTML tag I've used before: <META HTTP-EQUIV="Refresh" CONTENT="10; URL=main.html"> This should be put in the <HEAD> tag of the page you want showing for 10 seconds or so. The "10" means the page will be redirected to the page in the URL field after 10 seconds ("main.html" here). If you still want to use PHP, you can redirect the user to another site using header("Location: somelink.php"); ...but only if there are no HTML tags prior to this line in your code. To do it after a certain amount of time, it looks similar to the code inside the first tag up there: header('Refresh: 10; URL=http://www.example.com'); Hope this helps.
__________________ CPU: AMD Athlon 64 X2 5200+ Windsor, 2.6 GHz RAM: CORSAIR XMS2 2GB 240-Pin DDR2 VIDCARD: EVGA PCI-Express x16 GeForce 7900GS 256MB MOBO: ASUS M2N-SLI Deluxe AM2 HDD: Seagate Barracuda 320GB 7200 RPM SATA my blog: http://jspot.gotdns.com |
| | |
| | #3 (permalink) |
| Ultra Techie | You can use php for other stuff and insert javascript into the page for the redirect. For instance this is a page I did that redirects after showing the results of a contact form: PHP Code: var speed is how long it will take (ms, 3000=3 secs, 5000=5 secs, etc.)
__________________ Frodo failed! BUSH has the ring! ______________________________________ Q9650 E0 stock for now | EVGA nForce 780i SLI 4GB Corsair Dominator DDR2 1066 | (2x) 8800 GT, 700/1000 in SLI (2x) 74GB Raptors in RAID-0 | (1x) 320 GB Cuda | (1x) 750 GB Cuda Soundblaster X-FI | Sceptre 20.1" Widescreen LCD Monitor Gigabyte 3D Aurora Case | Cooler Master Real Power Pro 850W PSU Thermalright Ultra 120 Extreme HSF Dual boot, WinXP Pro & Vista Ultimate 64bit | 3dMark06 21,519 | TF2 Stats Page Last edited by synergy; 04-17-2007 at 01:06 PM. |
| | |
| | #4 (permalink) |
| Master Techie | If you use Code: <?php
header('Location: blahblah.com');
?> To fix that, you'll have to use output buffering. Example: Code: <?php
ob_start();
header('Location: blahblah.com');
ob_end_flush();
?> It's best to put ob_start(); as the very first piece of code on your page, and put ob_end_flush(); at the very end, therefore buffering (executing) the PHP before anything else. |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| php help | ben_ben | Programming Discussions | 8 | 04-20-2007 05:32 PM |
| PHP 2-player game? | thejeremy | Programming Discussions | 4 | 04-09-2007 06:01 PM |
| Remote file access w/ IP + PHP? | thejeremy | Programming Discussions | 2 | 04-04-2007 05:24 PM |
| is this version of PHP installer outdated? | kwokwai | Programming Discussions | 2 | 04-04-2007 03:05 AM |