View Single Post
  #1  
Old 03-06-2006, 10:21 PM
7steij17 7steij17 is offline
SEO Junior
 
Join Date: May 2005
Posts: 13 7steij17 is on a distinguished road
Easy script problem (showing current url)

Good evening

Ok, I am using Advanced Poll script and .htaccess, which is proving to be a problem, see when people vote, they are taken to the .php page instead of the rewritten page.

Here's an example, /fight.html is actually /cool/fight.php so when people vote on /fight.html they are taken to /fight.php which doesn't even exist, I want it to take people to the current page they are on after rewrite not before rewrite. Here is the script

Quote:
<?php

$include_path = dirname(__FILE__);
if ($include_path == "/") {
$include_path = ".";
}

if (!isset($PHP_SELF)) {
global $HTTP_SERVER_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
$PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"];
if (isset($HTTP_GET_VARS)) {
while (list($name, $value)=each($HTTP_GET_VARS)) {
$$name=$value;
}
}
if (isset($HTTP_POST_VARS)) {
while (list($name, $value)=each($HTTP_POST_VARS)) {
$$name=$value;
}
}
if (isset($HTTP_COOKIE_VARS)) {
while (list($name, $value)=each($HTTP_COOKIE_VARS)) {
$$name=$value;
}
}
}

global $POLLDB, $POLLTBL, $CLASS;
require $include_path."/include/config.inc.php";
require $include_path."/include/$POLLDB[class]";
require $include_path."/include/class_poll.php";
require $include_path."/include/class_pollcomment.php";
require $include_path."/include/class_plist.php";

$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();
#$php_poll = new poll();
#$php_poll_comment = new pollcomment();
$php_poll = new plist();

?>


So basically this script take people to the directory that the page is rewritten in (not the file where the file is), and the name of the file (not rewritten, so if origanal file was go.php and rewritten is go.html it take people to the file go.php).

So what it does:

Rewritten page: /go.html Non-Rewritten: /dir/go.php When you click vote you go to: /go.php

What I want:

When you click vote, you go to the exact page that was in the address bar before.

Hopefully I wasn't to confusing, if I was please tell me. I am lost, and will take any help anyone will give me, thanks in advance.
Reply With Quote