Question with PHP code

oab

New Member
Messages
918
Reaction score
0
Points
0
so when you login you only want it to refresh the middle part??

hmmm well i would use javascript...

i guess you can use an iframe but i think your going to regret it later... but go ahead..
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
well i have javascript for my menu...everytime i click on a menu page it will change the iframe to that page...unless you have a better way of doing it...i just need to make sure the banner at the top of the page dosnt refresh
 

oab

New Member
Messages
918
Reaction score
0
Points
0
look up "ajax" on google and read up on it, i think you will be quite intruiged..


hmmm im having some trouble with the form validation im going to sek help, i should be at least done with the login script tonight and then i can hopefully get the profiles done tomorrow and then provite message system the day after that, i could probably finish it tomorrow but i have stupid work to go to... hate work....
 
Last edited:

dpogary

New Member
Messages
134
Reaction score
0
Points
0
well i just decided that a better way to do things is to make a second flash banner(exact same) without the embeded music...so only the welcome page has the music...the rest of the site dont...it will eliminate the need for frames or anything all together
 

oab

New Member
Messages
918
Reaction score
0
Points
0
yes that is a good idea, well my script might takw longer than planned since im going to have to learn javascript in the proccess, lol, im having a LOT of trouble with this..
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
Lol i think this script you are doing should be mainly for your personal use...i am working on a system that should have everything i need...but it will take me a VERY long time to do because its gonna have alot in it
 

Chris S

Retired
Messages
2,055
Reaction score
1
Points
38
The problem in the code is that you aren't escaping quotes in your echo.

PHP:
<?
include("cons.php");
$user = USER;
echo "Inbox | <a href="compose.php">Compose</a><br>"; 
$info = mysql_query("SELECT * FROM pm WHERE whoto='$user'");
if (READ) {
$read = mysql_query("SELECT * FROM pm WHERE whoto='$user' AND readit='no'");
$numread = mysql_num_rows($read);
echo "You have ".$numread." new messages";
}
if (mysql_num_rows($info) == 0) {
echo "<br>No messages in your inbox!";
}else{
 
if (SUBJECT && READ && TIME){
echo "<table><tr><td>Subject</td><td>From</td><td>Read</td><td>Time Sent</td><td>Delete?</td></tr>";
}

in this line see how you have an echo
PHP:
echo "Inbox | <a href="compose.php">Compose</a><br>";

Basically you need to make that like look like and escape the quotes inside the echo
PHP:
echo "Inbox | <a href=\"compose.php\">Compose</a><br>";


When ever you do echo "xxxxxxx" and have double quotes inside there are two well maybe three things you can do.
1. You can escape all the double quotes except the opening quote of the echo and the closing quote of the statement
2. You can change all double quotes inside the echo into single quotes
*3. You can change the double quotes on the outside to a single quote.

*Note: No PHP will be excuited inside the single quote echo.
 
Last edited:

oab

New Member
Messages
918
Reaction score
0
Points
0
hahaha oh yea simpson thanks for pointing that out, how did i miss that? lol

you can always just use single ' for the echo, then you can have " inside the echo without escaping them, its a little easier in my opinion..
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
i havnt done much on my code yet...today has been iffy and i wnot be able to code all night because i got work in the mornin
 

oab

New Member
Messages
918
Reaction score
0
Points
0
yea mines coming along taking A LOT longer than i thought it would though, working on the cookies and password encryption now.
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
right out of no were they had me work yesterday,today and tomarrow...lol i aint having any extra time
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
Man, Ive been busy, i went home for a few days and i was busy fixing my computer(Completly re formatting everything) and i just got back, but i am still getting busy around here. so idk when ill have the time to work on this code
 

dpogary

New Member
Messages
134
Reaction score
0
Points
0
well im kinda working on it...im kinda looking at some tutorials and books trying to learn PHP more
 
Top