| | |
redirecting in php
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
-1
#11 Nov 2nd, 2009
Do any of your php pages show as "proper webpages" in FF? It's just possibel that the Apache webserver, although installed, is not on. I am not familiar with WAMP (I use XAMPP), but I assume it has a control panel - check to see if Apache is on.
In addition, perhaps it would be useful to check your hosts and vhosts files - usually something like this):
C:\Windows\System32\drivers\etc\hosts
C:\xampp\apache\conf\extra\httpd-vhosts.conf (yours will probably be under some sort of wamp directory).
The hosts file (note no file extension) should contain something like:
The other file should contain something like:
These files are where you'd add your virtual local sites
//EDIT
Just looked over the first couple of posts again:
If the above won't work, it's not because you can't find the localhost through the header command, it's probably because php won't run at all in this location (localhost).
Can you run a simple
page?
In addition, perhaps it would be useful to check your hosts and vhosts files - usually something like this):
C:\Windows\System32\drivers\etc\hosts
C:\xampp\apache\conf\extra\httpd-vhosts.conf (yours will probably be under some sort of wamp directory).
The hosts file (note no file extension) should contain something like:
•
•
•
•
127.0.0.1 localhost
::1 localhost
•
•
•
•
NameVirtualHost 127.0.0.1
//EDIT
Just looked over the first couple of posts again:
PHP Syntax (Toggle Plain Text)
header('Location:http://www.yahoo.com');
If the above won't work, it's not because you can't find the localhost through the header command, it's probably because php won't run at all in this location (localhost).
Can you run a simple
PHP Syntax (Toggle Plain Text)
echo "hello world!";
page?
Last edited by ardav; Nov 2nd, 2009 at 1:12 pm.
If you don't reply to your own thread or you can't find the solved link - you're off my Christmas list - permanently! Bah humbug!
•
•
Join Date: Oct 2009
Posts: 12
Reputation:
Solved Threads: 1
0
#12 Nov 2nd, 2009
make a file called phpinfo.php with the folowing code:
Now if PHP is installed & working correctly, you should see a load of data & variables in a table with a purple background. If not, something is wrong with your PHP/Apache install.
Joshhh
php Syntax (Toggle Plain Text)
<?php phpinfo(); ?>
Now if PHP is installed & working correctly, you should see a load of data & variables in a table with a purple background. If not, something is wrong with your PHP/Apache install.
Joshhh
•
•
Join Date: Jun 2009
Posts: 121
Reputation:
Solved Threads: 2
-1
#13 Nov 3rd, 2009
Try this
it can be possible that short tags are off in php.ini. So Try once the above code.!!
php Syntax (Toggle Plain Text)
<?php header("Location:yahoo.com"); ?>
it can be possible that short tags are off in php.ini. So Try once the above code.!!
Last edited by sam023; Nov 3rd, 2009 at 5:39 am.
•
•
Join Date: Oct 2009
Posts: 9
Reputation:
Solved Threads: 1
0
#14 Nov 3rd, 2009
PHP Syntax (Toggle Plain Text)
<meta http-equiv="refresh" content="1; URL=http://yahoo.com">
•
•
Join Date: Jul 2009
Posts: 45
Reputation:
Solved Threads: 2
0
#16 Nov 3rd, 2009
@ardav : i have installed xampp now, thought that something's wrong with wamp. but everything is still the same. i have checked those files, the one in win32 is okay, but i can't find "NameVirtualHost 127.0.0.1" in httpd-vhosts.conf. what should i do? anyway, i installed xampp in c/program files/xampp not in c/xampp, is it okay? and i can run simple php file like that hello world.
@rokape : yes, it works. seems nothing's wrong with my php installed here. thanks for your response.
@sam023, manus : they all don't work, still leads to a blank page
@foxwizzy : you mean i must write it like this?
but i only get this in my page
"; ?>
@rokape : yes, it works. seems nothing's wrong with my php installed here. thanks for your response.
@sam023, manus : they all don't work, still leads to a blank page

@foxwizzy : you mean i must write it like this?
PHP Syntax (Toggle Plain Text)
<? echo "<meta http-equiv="refresh" content="1; URL=http://yahoo.com">"; ?>
but i only get this in my page

"; ?>
-1
#19 Nov 3rd, 2009
I shouldn't have thought it would make much difference, but have you included an
on the next line after the header() statement?
In addition, make sure there is no html output including any white space before the header().
PHP Syntax (Toggle Plain Text)
exit;
In addition, make sure there is no html output including any white space before the header().
If you don't reply to your own thread or you can't find the solved link - you're off my Christmas list - permanently! Bah humbug!
•
•
Join Date: Jul 2009
Posts: 45
Reputation:
Solved Threads: 2
0
#20 Nov 3rd, 2009
you mean this?
i have tried that and nothing happens again
PHP Syntax (Toggle Plain Text)
<? session_destroy(); header("location:index.html"); exit; ?>
i have tried that and nothing happens again
![]() |
Other Threads in the PHP Forum
- Previous Thread: session in php
- Next Thread: Multiple file upload through an array
Views: 1361 | Replies: 30
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date development directory display download dynamic echo email error file files folder form forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube






