-
-
2. Re: PHP redirect
Max Resnikoff Oct 15, 2014 9:50 AM (in response to bregent)Sorry, I forgot to add:
I want it to redirect within the directory; ../../main/index.php . Not through http://...
-
3. Re: PHP redirect
bregent Oct 15, 2014 10:53 AM (in response to Max Resnikoff)Why don't you want to include the protocol? In any case, a redirect will work with doc relative paths also.
-
4. Re: PHP redirect
Max Resnikoff Oct 15, 2014 11:12 AM (in response to bregent)Because I do not yet have a server for the site.
-
5. Re: PHP redirect
osgood_ Oct 15, 2014 11:18 AM (in response to Max Resnikoff)Use the php 'header' function:
<?php
$id = $_GET['id'];
$sql = "UPDATE clients SET cancel=1 WHERE id = $id";
mysql_query($sql);
header ('Location: index.php');
?>
-
6. Re: PHP redirect
bregent Oct 15, 2014 11:18 AM (in response to Max Resnikoff)OK. Like I said, http redirects should work with doc relative links too.
header("Location: ../../main/index.php");
-
7. Re: PHP redirect
MurraySummers Oct 15, 2014 2:51 PM (in response to bregent)PHP.net says you should always use absolute links with the header() command (according to HTTP/1.1) stating that SOME clients accept relative URIs. Me? I always use absolute links.
-
8. Re: PHP redirect
Rob Hecker2 Oct 15, 2014 2:55 PM (in response to MurraySummers)Murray, I always use relative links because otherwise the redirects would not work on both my development and production environments. No clients have ever reported an issue.



