Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. They don't know that a different IP is the same guest. Generally the way they detect fraud is trend anlysis. If your site regularly generates 100 clicks per hour on average, then all of a sudden that number jumps to 10000 clicks per hour, they are going to suspect something. Google is one of the best out there at doing statistical analysis of just about everything.........
  2. If you are using serialize and unserialize, use addslashes (http://www.php.net/addslashes) before you serialize, then use stripslashes (http://www.php.net/stripslashes) after you unserialize. If you are using an SQL query, assuming you are using MySQL, use mysql_real_escape_string (http://www.php.net/mysql_real_escape_string) on the data before you insert it into your query. $query = "INSERT INTO table (a, b, c) VALUES ('" . mysql_real_escape_string($x1) . "', '" . mysql_real_escape_string($x2) . "', '" . mysql_real_escape_string($x3) . "')
  3. Change: $query = mysql_query("SELECT id, title, category, status FROM software"); to: $query = mysql_query("SELECT id, title, category, status FROM software") or die(mysql_error()); Then see what error you are getting.
  4. http://www.php.net/file http://www.php.net/file_get_contents http://www.php.net/fopen http://www.php.net/fread
  5. The first phpfreaks competition focused on creating a php based "graphing calculator". I recommending checking out some of the submissions to that competition: http://www.phpfreaks.com/forums/index.php/board,64.0.html Specifically this page: http://www.phpfreaks.com/forums/index.php/topic,115293.15.html
  6. Javabridge links this page: http://www.dsl.uow.edu.au/~sk33/phpjava.htm for reference on setting up their "bridge" for Win32 systems. The very first line in the to-do list reads: Your first post states: Me thinks you should read the documentation
  7. ProjectFear: fwrite and fputs are the same command. Tutorial: http://www.phpfreaks.com/tutorials/9/0.php Through the magic of html Through the magic of php...specifically the file funtions (http://www.php.net/file, http://www.php.net/fopen, http://www.php.net/fwrite, http://www.php.net/fclose), implode (http://www.php.net/implode), explode (http://www.php.net/explode), serialize (http://www.php.net/serialize), unserialize (http://www.php.net/unserialize), and an understanding of arrays. Tutorial: http://www.phpfreaks.com/tutorials/78/0.php
  8. Both of your sub-if statements are the same: [code]if ($i % 10 == 0) { echo "<td>1 $i: <b>" . chr($i) . "</b><br /></td></tr><tr>";[/code] [code]if ($i % 10 == 0) { echo "<td>2 $i: " . chr($i) . "<br /></td></tr><tr>";[/code]
  9. [quote]I modify this one (global.inc.php):[/quote] Yes..enter your information between the single quotes: [code]<?php $host = 'your_database_host_name';      $user = 'your_user_name'; $pass = 'your_password'; $name = 'the_database_name'; $db = &new MySQL($host,$user,$pass,$name); ?>[/code]
  10. change: [code]if('$cmd'=="delete")[/code] to [code]if($cmd=="delete")[/code]
  11. You shouldn't have to worry about this part (the mysql class) of the script at all.  The global.inc.php file contains all of your connection credentials. That class is correct.  The $this-> operator refers to the variable that is contained in that class... [code]class MySQL {     /**     * MySQL server hostname     * @access private     * @var string     */     var $host;     /**     * MySQL username     * @access private     * @var string     */     var $dbUser;     /**     * MySQL user's password     * @access private     * @var string     */     var $dbPass;     /**     * Name of database to use     * @access private     * @var string     */     var $dbName;     /**     * MySQL Resource link identifier stored here     * @access private     * @var string     */     var $dbConn;     /**     * Stores error messages for connection errors     * @access private     * @var string     */     var $connectError;     /**     * MySQL constructor     * @param string host (MySQL server hostname)     * @param string dbUser (MySQL User Name)     * @param string dbPass (MySQL User Password)     * @param string dbName (Database to select)     * @access public     */     function MySQL ($host,$dbUser,$dbPass,$dbName) {         $this->host=$host;         $this->dbUser=$dbUser;         $this->dbPass=$dbPass;         $this->dbName=$dbName;         $this->connectToDb();     }     /**     * Establishes connection to MySQL and selects a database     * @return void     * @access private     */     function connectToDb () {         // Make connection to MySQL server         if (!$this->dbConn = @mysql_connect($this->host,                                       $this->dbUser,                                       $this->dbPass)) {             trigger_error('Could not connect to server');             $this->connectError=true;         // Select database         } else if ( !@mysql_select_db($this->dbName,$this->dbConn) ) {             trigger_error('Could not select database');             $this->connectError=true;         }     }     /**     * Checks for MySQL errors     * @return boolean     * @access public     */     function isError () {         if ( $this->connectError )             return true;         $error=mysql_error ($this->dbConn);         if ( empty ($error) )             return false;         else             return true;     }     /**     * Returns an instance of MySQLResult to fetch rows with     * @param $sql string the database query to run     * @return MySQLResult     * @access public     */     function query($sql) {         if (!$queryResource=mysql_query($sql,$this->dbConn))             trigger_error ('Query failed: '.mysql_error($this->dbConn).                           ' SQL: '.$sql);         return new MySQLResult($this,$queryResource);     } }[/code] Notice at the top...the "var $host;" line.  When he writes "$this->host" from inside the class, it is refering to the value of that variable.
  12. [code]foreach ($_POST as $key => $value) {   if ($key != "submit") {     ...do stuff...   } }[/code]
  13. [quote]the support for the script is about as limited as my php knowledge is[/quote] So you admit that you know little about php, but you are able to tell when someone is incorrect without even testing what they said? [quote]I really don't think it matters[/quote] My money is on Hypnos' being correct: [quote]Maybe you ment to put something like this... $this->host = "mysql213.secureserver.net";[/quote]
  14. Use the full php opening tag... "<?php" not "<?". If it still doesn't work, check to make sure your server has php enabled / installed.
  15. Add in error checking and an echo to see what the value of $row['password'] is... [code]<?php session_start(); include("loginfo.php"); $table = 'userinfo'; $email = $_POST['email']; $password = md5($_POST['password']); $wtd = "relogin"; if ($wtd == "relogin") { $tc = mysql_connect($host, $user, $pass) or die(mysql_error()); $db = mysql_select_db($database, $tc) or die(mysql_error()); $query = "SELECT password FROM $table WHERE email='$email'"; $result = mysql_query($query) or die(mysql_error()); $password_check = mysql_result($result, 0); if ($password == $password_check) { echo "You are logged in"; } else { echo "Not logged in: <br />submitted password md5: $password<br />stored password md5: $password_check"; } } ?>[/code]
  16. Try google, I'm sure you can find something there: http://www.google.com/search?hl=en&q=php+time+logged+in+tutorial&btnG=Google+Search
  17. Use <pre></pre> tags? I have no idea what you're asking for.......
  18. Under certain conditions it is, if you are running php as cgi, then it's not. from http://www.php.net/mysql_pconnect: [quote]Note, that these kind of links only work if you are using a module version of PHP[/quote] Read this page for more details: http://us3.php.net/manual/en/features.persistent-connections.php Did you even try the code that I gave you?  Assuming that your code is exactly as you posted it, then you are getting the error on that line (the mysql_pconnect that is not assigned to a variable).  If you haven't tried it, do so.  If you have, are you still getting an error?
  19. the session_start() must be above where ever you are using any $_SESSION variable.  If you are using sessions, it is generally safe to ALWAYS MAKE SESSION_START() THE FIRST THING IN YOUR SCRIPT.
  20. Even when you are looking at a directory listing like that, it's still HTML.  So you will need to take the html, then search for links to files.  Someone who's better with regex can help with that. What I can tell you is that there is a better way to get the html than you are using: [code]$remote_html = file_get_contents("http://www.vobe.frihost.net/testing/");[/code] Alternatly use sockets, there are some good examples on the fsockopen manual page: http://www.php.net/fsockopen
  21. at that point in the script has the $db object been initialized? In other words, have you created a new database object and assigned it to the $db variable... [code]$db = new database();[/code]
  22. Why are you using mysql_pconnect?  99.99% of the time you should use mysql_connect.  Additionally, you are not assigning the connection to a variable... [code]$connection = mysql_connect($hostname, $username, $password) or die(mysql_error());[/code]
  23. what is the full code of your script?
×
×
  • 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.