Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. If you want to redirect a user use header, For example say you had a login script and then you checked for the logout variabled in the url If you find it you'll redirect the user to the logout page: [code=php:0]if(isset($_GET['logout') && $_GET['logout'] == 'true') {     header("Location: logout.php"); }[/code]
  2. Lookimg at your code. You want to use $query rather than $result on this line: [code=php:0]if (mysql_num_rows($result) != 0) {[/code] mysql_num_rows requires the result resource from mysql_query. Not from mysql_fetch_array. mysql_fetch_array returns the results from the query into an array. OS the above line should be this: [code=php:0]if (mysql_num_rows($query) != 0) {[/code]
  3. As you ar using a MySQL keyword for a field name  in your users table. You'll want to use the following as the query: [code]SELECT * FROM users WHERE `username`='$user' AND `password`='$pass'[/code]
  4. If you want to create a dead basic forum. Then prehaps have a look at [url=http://tutorials.scudworkz.com/tutorial/php/basic_forums.scud]this tutoriall[/url]. Also there a re few books out there too you can buy which shows you to create a everyday PHP apps such as a forum, content management system, ecommerce sites etc. Prwhap go to your local books store/library and have a look. Creating a forum is no easy task. edit: forgot to add the link in. :)
  5. When working with arrays, which session variable is you wrap the array key in quotes, unless you use a constant or you;re using a numeric value for the key. The array key is the letters/numbers between the square brakets.
  6. wildteen88

    Numeric

    number_format http://php.net/number-format
  7. Dont use positioning. Learn to use float. Basically remove any positioning you have. The float #web_sites and #web_window left: [code]#web_sites, #web_window {   float: left; }[/code] Now you want to clear the floats by adding clear: both to #footer
  8. I did a typo, I typed { instead of (. So use this as the last rewrite rule: [code]RewriteRule ^([A-Za-z]+)/([0-9+])$ gallery.php?id=$1&sub=$2 [L][/code]
  9. Thats why. INT only accepts integer values (whole numbers). MySQL is thinking your're adding a float to the IP field, so it strips of the decimals. Change the field type for the IP column to VARCHAR instead.
  10. not sure what you mean. Could you explain that a bit more. amke sure the IP column in the database is set to 15 if its a varchar field. As an IP addy has a max 12 numbers and 3 periods
  11. Thats using the old SQL query. The new on should be this: [code=php:0]$sql1 = "INSERT INTO `users` (`username` , `password` , `points` , `IP` , `email` , `fname` , `lname` , `gender` , `age` , `location` , `registered` , `last_login` , `admin` , `orientation` , `ethnic` , `music` , `AIM` , `YIM` , `MSN` ) VALUES ('{$username}', '{$pw}', '5000', '{$REMOTE_ADDR}', '{$email}', '{$fname}', '{$lname}', '{$gender}', '{$age}', '{$location}', '{$day}', '{$day}', '0', '{$orientation}', '{$ethnic}', '{$music}', '{$AIM}', '{$YIM}', '{$MSN}' );";[/code]
  12. Whoops. The following: [code=php:0]array_map('mysql_real_escape_string', $_POST, $_GET);[/code] should be: [code=php:0]array_map('mysql_real_escape_string', $_POST); array_map('mysql_real_escape_string', $_GET);[/code]
  13. Try this as the query: [code=php:0]$sql1 = "INSERT INTO `users` (`username` , `password` , `points` , `IP` , `email` , `fname` , `lname` , `gender` , `age` , `location` , `registered` , `last_login` , `admin` , `orientation` , `ethnic` , `music` , `AIM` , `YIM` , `MSN` ) VALUES ('{$username}', '{$pw}', '5000', '{$REMOTE_ADDR}', '{$email}', '{$fname}', '{$lname}', '{$gender}', '{$age}', '{$location}', '{$day}', '{$day}', '0', '{$orientation}', '{$ethnic}', '{$music}', '{$AIM}', '{$YIM}', '{$MSN}' );";[/code] also add the following: [code=php:0]// help protect sql injection attacks array_map('mysql_real_escape_string', $_POST, $_GET);[/code] before: [code=php:0]extract($_POST);[/code]
  14. No post the full error message. Do not cut the error message
  15. You can learn about comments over at [url=http://www.php.net/manual/en/language.basic-syntax.comments.php]php.net[/url]
  16. Ok. I got rid of all the heredoc statements. Try this: [code]echo '     <tr>         <td><img src="images/cat_left_top.jpg" width="180" height="40"></td>     </tr>'; $categories = mysql_query("SELECT * FROM store_categories ORDER BY id"); while($c = mysql_fetch_assoc($categories)) {     echo '     <tr>         <td class="cat_text">             <a href="?list=' . $c['id'] .'">' . $c['categorie_name'] . '</a>';     if(isset($_GET['list']) && is_numeric($_GET['list']) && $_GET['list'] == $c['id'])     {     $_GET['list'] = mysql_real_Escape_string($_GET['list']);         $sql = "SELECT * FROM store_categorie_list WHERE list_categorie_id='" . $_GET['list'] . "' ORDER BY id";         $c_list = mysql_query($sql);         echo "\t\t\t<p>\n";         while($c_list_item = mysql_fetch_assoc($c_list))         {             echo "\t\t\t\t--- {$categorie_list_get['list_name']}<br />\n";         }     }     echo '             </p> </td>     </tr>'; } echo '     <tr>         <td height="0"><hr align="center" width="170" size="1" noshade class="cat_bar"></td>     </tr>';[/code] if you cannot get that code to work then there is an error with your code. if you get any error post the full code here.
  17. Change this: [code=php:0]mysql_query("$sql1"); $sql1;[/code] to this: [code=php:0]mysql_query("$sql1") or die("Error with query: {$sql1}<br />\n" . mysql_error());[/code]
  18. Should work I see now reason why it shouldnt. the only option is to put the php.ini either the Windows folder (C:\WINDOWS) or the system23 folder (C:\WINDOWS\system32). Or add the php installation folder to the PATH variable.
  19. Prehaps you want to use the preformatted text tag: [code]<pre>  hey what every i place in     here is what will be                     shown in the         browser!</pre>[/code]
  20. Could you post the code here for the highlight_php function. Also the C/C++ code will not be highlighted as its is not php code, and the highlight_string functionwill only highlight the php code if you add the php tags in (<?(php) ?>) if the open/closing php tags are not there the highlight_string function will not highlight the php code.
  21. Open you httpd.conf file for Apache and add the following to the end of the httpd.conf file: [code]PHPIniDir "C:/php5"[/code] Save the httpd.conf file and restart Apache. PHP should now be using the correct php.ini Not sure about the your secound question though. Is this error coming from phpMyadmin or from Apache?
  22. Yeah. You just need to add a newr rewrite rule after your other one for that: [code]RewriteRule ^([A-Za-z]+)/{[0-9+])$ gallery.php?id=$1&sub=$2[/code] So your htaccess file should like this: [code]RewriteEngine On RewriteRule ^([A-Za-z]+)$ gallery.php?id=$1 RewriteRule ^([A-Za-z]+)/{[0-9+])$ gallery.php?id=$1&sub=$2 [L][/code]
  23. Use four non-braking spaces - & nbsp; (without the space before &) Not sure what you mean though.
  24. See if adding a forward slash at the end of the url resolves this: http://host/phpMyAdmin/
  25. htaccess folder can be placed anywhere. So you can place it in the subdirecotry if you want. However keep in mind what ever setting/configuration you have in the htaccess file will work when you go to the subfolder you put the htaccess file in.
×
×
  • 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.