Hi, I am trying to alter this code slightly to get it to work on my web layout. The code tells a shoutbox script to refresh to a designated url after you make a post. If I leave the code as is when you make a post it will take you to the shoutbox page which will produce nothing. I want the shoutbox inline with my layout so when you make a post and it refreshes it takes you back to the page you made the post from. Here is the snippet of code they give
$page = $PHP_SELF;
$c = strlen($page);
while (substr($page,$c,1) <> "/") { $page = substr($page,0,$c); $c--; }
$page .= "viewshoutbox.php";
The problem with this is it refreshes to viewshoutbox.php and not the page you started from. I can put the PHP page the shoutbox is on in place of the viewshoutbox.php and it works fine but I am planning on having the shoutbox on multiple pages and I would like it to refresh to the page you shouted from. So I tried some stuff but wasn't successful. Then I just did this.
$page = $HTTP_REFERER;
Which seems to work great untill I noticed how it was creating the new url. When you post on the shoutbox it adds a ?showall= to the end of the url which is fine and does normally. But if you make two post in a row it will double and you will end up with ?showall=?showall= at the end of the url. This then bypass the part of the code to tell the shoutbox how many shouts to display and then shows all of them. Even the archived ones.
Is there a way to make it refresh back to the url you posted from without it doin this?