View Full Version : What is wrong with this code?
Lysine
27-05-2006, 10:54 PM
http://www.hablaugh.dkhosting.co.uk/system/give.php
Warning: mysql_query(): Access denied for user 'nobody'@'localhost' (using password: NO) in /home/hablaugh/public_html/system/give.php on line 4
Warning: mysql_query(): A link to the server could not be established in /home/hablaugh/public_html/system/give.php on line 4
Warning: Cannot modify header information - headers already sent by (output started at /home/hablaugh/public_html/system/give.php:4) in /home/hablaugh/public_html/system/give.php on line 5
This is the error i get. This is for the techtuts badge system but i just get this error :(
aspeas
27-05-2006, 10:56 PM
Errrrmmm...
Sorry but I don't know
lol
craigg.
27-05-2006, 11:04 PM
First one you may have miss typed your password or host or DB name. If those are correct, try adding the user into that database - I often forget that part.
Could you also post lines 1-10 in the "give.php"
ShoutCast
27-05-2006, 11:05 PM
EDIT: craig beat me to it.
since its not using the password theres the erorr. did u set the password? pass='password' or w.e the password feild is on techtuts
Dan Williamson.
27-05-2006, 11:05 PM
Without the actual PHP/mySQL code we cannot check your code for errors or correct it but the first line seems to say that you are not using a password for mySQL connection.
Lysine
27-05-2006, 11:09 PM
<? $bn = $_POST['badge'];
$uname = $_POST['user'];
mysql_query("INSERT INTO badges (bname, uname) VALUES ('$bn', '$uname')");
header("Location: index.php?page=abadge");
?>
That is what is in give.php
ShoutCast
27-05-2006, 11:14 PM
Try this code:
<?
include("config.php");
$bn = $_POST['badge'];
$uname = $_POST['user'];
mysql_query("INSERT INTO badges (bname, uname) VALUES ('$bn', '$uname')");
header("Location: index.php?page=abadge");
?>
Lysine
27-05-2006, 11:16 PM
Try this code:
Thank you that works +Rep
ShoutCast
27-05-2006, 11:17 PM
make sure you include config.php in every file always seems to fix problems.
Lysine
27-05-2006, 11:20 PM
Ok :) ........
ShoutCast
28-05-2006, 12:24 AM
clear your inbox :S
Lysine
28-05-2006, 12:25 AM
have so :D
Sygon.
28-05-2006, 12:30 AM
make sure you include config.php in every file always seems to fix problems.
Thats if the config file exists or is called config.php ;)
ShoutCast
28-05-2006, 12:38 AM
ye it was the problem.
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.