Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. PHP can increment characters, just like it can with numbers. Example <?php $char = 'a'; for($i = 0; $i < (26*26*26+702); $i++) { echo ($char++) . "<br />\n"; } ?> Prints letters a through to zzz
  2. The \\\ is most probably caused by magic quotes. magic quotes escapes quotes automatically within $_GET, $_POST and $_COOKIE vars. I'd recommend disabling the magic quotes runtime altogether. For a simple fix you can use stripslashes function on the variable which gets the data out of your database. As for the pound symbol not sure on that one.
  3. Your query is wrong. A Valid UPDATE query example UPDATE table SET some_field='new_value' WHERE id=1
  4. You cannot wrap a div around tr or td tags. Just apply the id to the td tag you want to allow to scroll.
  5. Use the not equal to comparison operator (!=) if($var1 != $var2) { // no match } else { // match }
  6. That would indicate that there is a problem with your mysql query. Add or die(mysql_error()); after any calls to mysql_query, eg mysql_query('your query') or die(mysql_error());
  7. Yes. Use localhost as the hostname.
  8. You are missing a closing ) at the end of line 26 $humidity = mysql_real_escape_string(trim($_POST['humidity'])); // this is line 26
  9. To stop the loop if a match is made, add break; after $userban = "YES"; Also Change if($userban == "YES") { echo "Your banned"; } if($userban == "NO") { echo "Wooo Your not banned"; } to if($userban == "YES") { echo "Your banned"; } else { echo "Wooo Your not banned"; }
  10. Fix your first error and the last one will go away. As for why you get this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/./public_html/multi_operations/admin_functions.php on line 154 You most probably have an error in your SQL Query. Change $result = mysql_query($query); to $result = mysql_query($query) or die('MySQL Error: ' . mysql_error());
  11. The variable $this is a reserved in PHP5, you cannot redeclare it. You'll have to name your variable to something else.
  12. Are you referring to this thread? If so I'd recommend you to PM the Barand who locked the thread.
  13. The other machine most probably has display_errors disabled or error_reporting is set to ignore notices, this is why you dont get the underfined index message displayed. This also does not mean that your code is running fine on the other machine as no errors are displayed, they will be logged in your servers error log though.
  14. time() returns a unix timestamp which is an integer. VARCHAR is for storing strings. Correct your data type for the Setup field in your database and it should correct the issue. Set the Setup field data type to INT instead
  15. You can use phpMyadmin (which comes with XAMPP) for managing MySQL. If you want to use the command line. Then just open up the Command Prompt (Start > Run > cmd) Then at the command line just type mysql -u root -p and press enter. If XAMPP adds MySQL to the PATH this should work. If it doesn't then you'll have to navigate to the MySQL bin folder first, run the following command to change folders in the command line cd C:/xampp/mysql/bin Then run the mysql -u root -p command again
  16. When connecting to the MySQL server use: localhost as the hostname root as the username no password is set for the root username. MySQL is installed in C:\path\to\xampp\mysql
  17. When you use \t in a double quoted string PHP is adding in a tab. This is the problem line(s). echo "<\tr>"; Change your double quotes to single quotes. Or use echo "<\\tr>";
  18. Setup an array of possible passwords then check to see if the provided password is in the password array // set up array of possible passwords $passwords = array('pass1', 'pass2', 'pass3', 'etc..'); ... // check to see if the provided password is in the password array if (isset($_POST["password"]) && (in_array($_POST['password'], $passwords)) { // user logged in! }
  19. Your variables are the wrong way around $row[0]=$Zadmin; It should be $Zadmin = $row[0];
  20. Use nl2br
  21. First step would be the manual to understand the basics. Second would be to install a http server and PHP on your computer so you can run your scripts whilst learning/developing. Look into using WAMP (for windows only) or XAMPP (cross platform). Once you have an understanding the basics. Then have look for some PHP tutorials, such as http://www.php-mysql-tutorial.com also check out the free php e-book too.
  22. I think you mean what ohdang888 said: By that he/she meant to use tags when posting code to the forum. It helps to make code more readable and separates the code form what you're saying (text). I edited you post earlier and added the code tags. To mark topic solved, the button is in the menu at the bottom of page (before the quick reply box).
  23. No need to use complex expressions just use substr foreach ($namefill as $file_name) { $ext = substr($file_name, -4); if(strtolower($ext) == '.txt') { echo '<option value="' . $file_name . '">' . $file_name . '</option>'; } } NOTE: My syntax for substr maybe wrong. I corrected it.
  24. That code appears to be fine. No problems there. Seems strange why mysql_query is giving that error, as that error would show if the code in connect.php failed to connect to mysql. Could you post the code you're using in fd.php here
  25. Remove the quotes around $row[salt] echo "$row[salt]".Chr(13). Chr(10); Use: echo $row['salt'] . "\n";
×
×
  • 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.