Jump to content

DiscoTrio

Members
  • Posts

    78
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DiscoTrio's Achievements

Member

Member (2/5)

0

Reputation

  1. Here is another reason my host sucks: Warning: ini_set() has been disabled for security reasons in /www/zzl.org/r/o/b/robloxfashion/htdocs/voting.php on line 10 Warning: ini_set() has been disabled for security reasons in /www/zzl.org/r/o/b/robloxfashion/htdocs/voting.php on line 11
  2. DiscoTrio3bad For some reason the query won't go through the database...
  3. Its called the value that $rating returns, which is 1,2,3,4 I have that established and it works. And this server has SQL Buddy, I use PHPMYADMIN before...
  4. Im already not liking my new hosting company, now I can't get a sing query to work, Gevans, your query makes it return "Your query did not return any results. (0.0004 seconds)"
  5. Nope, thats what I just did and got that error.
  6. Hmm putting the query in directly says this: The following errors were reported:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1 ='1' WHERE username ='DiscoTrio'' at line 1
  7. I used to be good at this but I changed servers and everything is different... Heres my code so far: <?php $rated=$_REQUEST['rated']; echo $rated; $rating=$_REQUEST['rating']; echo $rating; // Make a MySQL Connection mysql_connect("localhost", "********", "********") or die(mysql_error()); mysql_select_db("*********") or die(mysql_error()); $result = mysql_query("SELECT * FROM main WHERE username = '$rated'") or die(mysql_error()); $row = mysql_fetch_array( $result ); $votes = $db_field['$rating']; $newvotes = $votes + 1; echo $newvotes; mysql_query("UPDATE main SET $rating = '$newvotes' WHERE username = '$rated'"); ?> Whats going on here is the colomb that I want to update comes as a variable $rated (That works) and then the database selects the row to update with $username (That works) and gets the variable $newvotes by taking the original value of the data its about to update and add 1 to it (That works) Then it updates the field to $newvotes.... I don't know why the update won't go through... there are no errors....
  8. I have a code from my friend that was written about two years back and there is one part I need help with: Somehow it remebers what page you came from and you stay on that page after you log in. I need help changing that to a certain page. Keep in mind the browser never goes to these log in scripts. This is the part of the session controll script that logs you in and somehow marks what page you came from: function startSession(){ global $database; session_start(); $this->logged_in = $this->checkLogin(); if(!$this->logged_in){ $this->username = $_SESSION['username'] = GUEST_NAME; $this->userlevel = GUEST_LEVEL; $database->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time); } else{ $database->addActiveUser($this->username, $this->time); } $database->removeInactiveUsers(); $database->removeInactiveGuests(); if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF']; } This finishes up your log in in another script: function procLogin(){ global $session, $form; /* Login attempt */ $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember'])); if($retval){ header("Location: ".$session->referrer); } else{ $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); header("Location: ".$session->referrer); } } In the first script I think (Not sure) these lines find out where your from and makes a value: if(isset($_SESSION['url'])){ $this->referrer = $_SESSION['url']; }else{ $this->referrer = "/"; } And this probably has somthing to do with making you go there... I am not familiar with ever using the header function... header("Location: ".$session->referrer); If I can I want to specify what page you go to after logging in... Thanx!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.