bloodling Posted July 29, 2011 Share Posted July 29, 2011 For the life of me i can not get this to work. Can someone please have a look at it. It is like 118 in notpad++ See the attachment for the entire .php document. if(empty($err)) { $sql_insert = "INSERT into `users` (`first_name`,`user_email`,`pwd`,`last_name`,`website`,`date`,`users_ip`,`activation_code`,`country`,`user_name` ) VALUES ('$data[first_name]','$usr_email','$sha1pass','$data[last_name]','$data[web]' ,now(),'$user_ip','$activ_code','$data[country]','$user_name' ) "; // THERE IS SOMETHING WRONG WITH THIS LINE I THINK IT IS LINE 118 NOTEPAD++ mysql_query($sql_insert,$link) or die("Insertion Failed:" . mysql_error()); $user_id = mysql_insert_id($link); $md5_id = md5($user_id); mysql_query("update users set md5_id='$md5_id' where id='$user_id'"); // echo "<h3>Thank You</h3> We received your submission."; [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 29, 2011 Share Posted July 29, 2011 before you make us read through 118 lines of code, what are the errors you're getting (and on what line numbers)? this is wrong: VALUES ('$data[first_name]','$usr_email','$sha1pass','$data[last_name]','$data[web]',now(),'$user_ip','$activ_code','$data[country]','$user_name')"; try echo(ing) out those variables beforehand, and you'll soon find the problem. Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 No sorry, i still cant get it to work. I have 1 year of html, php, sql under my belt. I got an attachment with all the .php scripts " I edited out my details" I have spent about 3-5 hours on this one problem so if you could give me a bit of advise or a resolution i would much appreciate it. Thank you in advance. [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted July 29, 2011 Share Posted July 29, 2011 What's the error/issue - what's it not doing that you think it should? what's it doing that you think it shouldnt? When you echoed out the sting as WebStyles suggested what did you get? Did you echo out the $sql_insert variable? // THERE IS SOMETHING WRONG WITH THIS LINE I THINK IT IS LINE 118 NOTEPAD++ echo $sql_insert; exit(); could you post what you get when you echo that? Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 I have just built a temporary website for this error http://shift.site40.net/main/login2/ The error is on http://shift.site40.net/main/login2/register.php I still have not figured out the error. Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 I have just built a temporary website for this error http://shift.site40.net/main/login2/ the .zip file has the source code in it " i have edited my user information in it" The error is on http://shift.site40.net/main/login2/register.php Just enter fake information and press register and you will get the error. Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a4541804/public_html/main/login2/register.php on line 118 I still have not figured out the error. Quote Link to comment Share on other sites More sharing options...
voip03 Posted July 29, 2011 Share Posted July 29, 2011 You have an error in your query. It isn't returning a valid resource. Print out $query, execute it in phpmyadmin/mysql. Then you ll know what's the error. You can also give die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
voip03 Posted July 29, 2011 Share Posted July 29, 2011 You have an error in your query. It isn't returning a valid resource. Print out $query, execute it in phpmyadmin/mysql. Then you ll know what's the error. You can also give die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 29, 2011 Share Posted July 29, 2011 bloodling, that's the 3rd time you've been asked you to echo (or print) your variables. Help us help you (please) Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 shift.site40.net Is ONE of my testing accounts so I will give you the user and pass, WebStyles could you take a look please host URL: www.000webhost.com user: tm9332@gmail.com pass: dacutie4124 oh and i don't use this email or password for anything else. Quote Link to comment Share on other sites More sharing options...
silkfire Posted July 29, 2011 Share Posted July 29, 2011 I tried your code and I didn't get an error message. I came to the tank you page right away. Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 Has it got something to do with line 35,36 of dbc.php ? I commented them out for some reason i cant remember now. There is nothing new in the database. Quote Link to comment Share on other sites More sharing options...
silkfire Posted July 29, 2011 Share Posted July 29, 2011 Maybe. I made my own link and it worked. Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 Has it got something to do with line 35,36 of dbc.php ? I commented them out for some reason i cant remember now. There is nothing new in the database. Arr i remember what i was doing now and i think it should work now // line 35,36 of dbc.php $link = mysql_connect("mysql3.000webhost.com", "a4541804_un", "itsgallus4124") or die("Couldn't make connection."); $db = mysql_select_db("a4541804_dn", $link) or die("Couldn't select database"); oops oh and that password i posted was wrong "but it was right in the code" lol well ill just be copying the files over to another host and IT WORKS thank you for all your help guys. Drinks on me! Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 How do i mark this as [sOLVED]? Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 29, 2011 Share Posted July 29, 2011 Drinks on me! I'll have a beer please. Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 maybe later...... Quote Link to comment Share on other sites More sharing options...
bloodling Posted July 29, 2011 Author Share Posted July 29, 2011 For people who got stuck on this probable or just want a php login script with email validation bla, bla, bla the license said that it was free no strings attached. It will still have all the settings completely unmodified from the time we got it working the link in below. http://shift.site40.net/main/login2/login2.zip Well i am going to go to bed before my typing goes down the drain. Thx Again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.