pnkgirl25 Posted August 21, 2007 Share Posted August 21, 2007 I am receiving the following errors: Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/f/o/c/focusevents/html/config.php on line 8 Parse error: parse error, unexpected T_VARIABLE in /home/content/f/o/c/focusevents/html/config.php on line 9 <?php $host="p41mysql63.secureserver.net"; // Host name ?$username="CourtneyBlacher"; // Mysql username ?$password="Fem62656265"; // Mysql password ?$db_name="temp_members_db"; // Database name ???//Connect to server and select database.?mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); ?mysql_select_db("$db_name")or die("cannot select DB"); ?> Any help at all would be great Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/ Share on other sites More sharing options...
dhruvasagar Posted August 21, 2007 Share Posted August 21, 2007 You php file code that you have pasted is not in correct format, but i think your problem is that you are having '?' in everyline...also while ending the php scriptlet your ending it like '??>' Please paste the proper code for better help. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329644 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 use this <?php $host="p41mysql63.secureserver.net"; // Host name ? $username="CourtneyBlacher"; // Mysql username ? $password="######"; // Mysql password ? $db_name="temp_members_db"; // Database name ???//Connect to server and select database.? mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); ? mysql_select_db("$db_name")or die("cannot select DB"); ?> replaced ###### with password Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329647 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Nope that didn't work either. I have been looking over this code for 3 hours. I cant seem to figure out that the heck is going on. Its driving me insane! Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329650 Share on other sites More sharing options...
mmarif4u Posted August 21, 2007 Share Posted August 21, 2007 I am not sure what u want from that code. Can u explain what u r doing mean u want to connect to db. Am i right... Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329651 Share on other sites More sharing options...
dhruvasagar Posted August 21, 2007 Share Posted August 21, 2007 please paste the code properly... Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329653 Share on other sites More sharing options...
itsmeArry Posted August 21, 2007 Share Posted August 21, 2007 try this out <?php $host="p41mysql63.secureserver.net"; // Host name $username="CourtneyBlacher"; // Mysql username $password="######"; // Mysql password $db_name="temp_members_db"; // Database name //Connect to server and select database. mysql_connect($host, $username, $password) or die("cannot connect to server"); mysql_select_db($db_name) or die("cannot select DB"); ?> Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329655 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 The code I am is bellow. When I pasted it into this forum I hit the code link but it still seems to not be formated right for you guys to review. How do I format it so I can past the right code? Also, the color code that appears is not the same code im looking at on my screen. I dont know why it keeps changing <?php $host="p41mysql63.secureserver.net"; $username="CourtneyBlacher"; $password="*********"; $db_name="temp_members_db"; Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect to server"); mysql_select_db("$db_name")or die("cannot select DB"); ?> Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329656 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 using either itsmeArry or my code (as their the same) can you paste that into notepad and save it and upload it what editor are you currently using? Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329658 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 try this out <?php $host="p41mysql63.secureserver.net"; // Host name $username="CourtneyBlacher"; // Mysql username $password="######"; // Mysql password $db_name="temp_members_db"; // Database name //Connect to server and select database. mysql_connect($host, $username, $password) or die("cannot connect to server"); mysql_select_db($db_name) or die("cannot select DB"); ?> I tried the code you gave me and still no luck. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329660 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 using either itsmeArry or my code (as their the same) can you paste that into notepad and save it and upload it what editor are you currently using? the reason i ask, is because the code is fine but the editor is probably messing it up.. can you edit in text only mode ( or source) Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329661 Share on other sites More sharing options...
itsmeArry Posted August 21, 2007 Share Posted August 21, 2007 What is the error you are getting... Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329662 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Im using a text editor to edit the script. I copied the script both of you posted and I am still getting the same error message. This is driving me crazy and Im ready to trow this laptop out the window! Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329663 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Im getting the following errors Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/content/f/o/c/focusevents/html/config.php on line 7 Parse error: parse error, unexpected T_VARIABLE in /home/content/f/o/c/focusevents/html/config.php on line 8 Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329665 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 Im using a text editor to edit the script. more detail needed!! Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329668 Share on other sites More sharing options...
dhruvasagar Posted August 21, 2007 Share Posted August 21, 2007 Perhaps there are some special characters in your username or password which are causing the problem.. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329669 Share on other sites More sharing options...
mmarif4u Posted August 21, 2007 Share Posted August 21, 2007 What is ur updated code. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329670 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 What details do you need? Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329672 Share on other sites More sharing options...
pranav_kavi Posted August 21, 2007 Share Posted August 21, 2007 r u using a \n sumwher in ur code or file that comes widin the limit of the php tags? Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329677 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Updated code is: <?php $host="p41mysql63.secureserver.net"; // Host name $username="CourtneyBlacher"; // Mysql username $password="###########"; // Mysql password $db_name="temp_members_db"; // Database name //Connect to server and select database. mysql_connect($host, $username, $password) or die("cannot connect to server"); mysql_select_db($db_name) or die("cannot select DB"); ?> Also, the password and user name are correct because the are working on the log in script I created. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329678 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 "a text editor" doesn't tell me much.. Ms Word is a "text editor"/"word processor" but that can really mess things up.. does the editor have a name ? is it an online one ? does it have other "modes" Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329682 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Oh okay sorry. I am using a Mac so its the text editor that came with that. It does not have a name (From what I can see) it just says TextEditor Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329684 Share on other sites More sharing options...
dhruvasagar Posted August 21, 2007 Share Posted August 21, 2007 Please confirm once again, does your password which you are using have some special characters? perhaps they are conflicting with php special characters while interpretation. Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329686 Share on other sites More sharing options...
pnkgirl25 Posted August 21, 2007 Author Share Posted August 21, 2007 Nope pass word is numbers and letters only. I don't think its the password since I built a login script yesterday using the password and that script works fine Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329689 Share on other sites More sharing options...
MadTechie Posted August 21, 2007 Share Posted August 21, 2007 Okay.. are you uploading via FTP ? (as that solves the CR problems) personally i would use BBedit on a Mac (or BBedit lite) Link to comment https://forums.phpfreaks.com/topic/65938-solved-newbie-needs-help-im-going-crazy-with-this-error-code/#findComment-329695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.