Just moved to a new domain and I have a problem.
Moderator: General Moderators
-
Wldrumstcs
- Forum Commoner
- Posts: 98
- Joined: Wed Nov 26, 2003 8:41 pm
Just moved to a new domain and I have a problem.
Wherever I have PHP in my page, it comes up with this warning:
"Notice: Use of undefined constant username - assumed 'username' in C:\Accounts\wwshssoc\wwwRoot\index.php on line whatever"
How the heck do I fix that?
"Notice: Use of undefined constant username - assumed 'username' in C:\Accounts\wwshssoc\wwwRoot\index.php on line whatever"
How the heck do I fix that?
On the first line:
Code: Select all
error_reporting(E_NONE);- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
The last thing you want to do is hide your problems.jshpro2 wrote:On the first line:Code: Select all
error_reporting(E_NONE);
Why not fix them...
The last time I saw that error message is when I forgot the $ for a variable name.
-
Wldrumstcs
- Forum Commoner
- Posts: 98
- Joined: Wed Nov 26, 2003 8:41 pm
I don't think I made it clear. All these pages work fine (I know because I had them on a previous site and just transferred them to the new domain). I changed the links and set up the databases, but thats it. The pages show up, but have all these little errors on them wherever there is PHP in the script.
Last edited by Wldrumstcs on Mon Jan 31, 2005 3:40 pm, edited 1 time in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
Wldrumstcs
- Forum Commoner
- Posts: 98
- Joined: Wed Nov 26, 2003 8:41 pm
Code: Select all
<tr>
<td width="100%" colspan="3" height="22" bgcolor="#FF7800">
<p align="center"><font size="4"> Main | <a href="homework.php">Homework</a> | <a href="links.php">Links</a> | </font> <a href="teachers.php">
<font size="4">Teachers</a> | <a href="tests.php">Tests</a><? IF($_COOKIEїusername] == "" OR $_COOKIEїpassword] == ""){ echo "";}ELSEIF($_COOKIEїusername] != "" AND $_COOKIEїpassword] != "" AND $_GETїa] != "logout"){ echo " | <a href='admin.php'>Admin</a>";} ?>
</font></td>
</tr>- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
Wldrumstcs
- Forum Commoner
- Posts: 98
- Joined: Wed Nov 26, 2003 8:41 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
Wldrumstcs
- Forum Commoner
- Posts: 98
- Joined: Wed Nov 26, 2003 8:41 pm
Sorry, I hadn't seen your post when I asked that. Anywho, the quotes are annoying cuz I gotta go thru each page and change them. I can't just do "Replace All" because some things are already in quotes. What is wrong with this below script. It says unexpected 'T_STRING' or 'T_variable'.
Code: Select all
<? IF($_COOKIEї'username'] == "" OR $_COOKIEї'password'] == ""){ echo "You are not logged in. <a href='http://www.***.com/login.php'>Click here to login.</a>";}ELSEIF($_COOKIEї'username'] != "" AND $_COOKIEї'password'] != ""){ echo "Welcome $_COOKIEї'username']. <a href='logout.php'>Click here to logout.</a>";} ?>- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
php is getting confused as to what you are intending to do. When placing variables inside a double quoted string, it is recommended that you add braces around the variable so php knows how to add the information needed. Although making all strings single quote strings, and using concatenation to add variables to them is recommended more often.