it aint working and config.php isnt there, i am using apache 2.2.4 and php 5.2.1PHP Code:if (!file_exists('config.php')) {
header("Location: install/install.php");
}
SIMPLEST thing ever and it isnt working, wtf...
it aint working and config.php isnt there, i am using apache 2.2.4 and php 5.2.1PHP Code:if (!file_exists('config.php')) {
header("Location: install/install.php");
}
SIMPLEST thing ever and it isnt working, wtf...
Thanks,
Brandon Long
PHP header() redirects won't work with relative URLs; they will only work with the whole thing (i.e. with the "http://yourwebsite.com/"). Here's how you would do this:
(I got this from a PHP manual page and modified it slightly)PHP Code:<?php
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
header("Location: http://$host$uri/install/install.php");
exit;
?>
Last edited by Cubeform; 02-10-2007 at 05:08 PM.
CUBEFORM
XHTML | CSS | PHP | JavaScript
THIS WEEK
you could try
i made it to redirect and it works finePHP Code:<?php
function goToUrl($ref, $url){
if ($url == ''){
$url = 'index.php';
}
header ( "refresh: $ref; url=".str_replace('&', '&', $url) ) ;
}
?>
or try:
PHP Code:<?php
header('Location: '.str_replace('&', '&', 'http://www.example.com/?do=1&go'));
?>
Last edited by dharmil; 02-10-2007 at 05:55 PM.
- Dharmil
The redirect is fine
its that file_exists thing
Thanks,
Brandon Long
Do you get an error at all, or does it just not return true/false like it "should?"
****, thats the problem, i was editing a read-only file and it wasnt saving, it works now:-P
Last edited by Brandon; 02-10-2007 at 07:43 PM.
Thanks,
Brandon Long