-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
php....code...? me thinks you should stop now and maybe take up a sport, like archery or somthing. That's all CSS that is.
-
You know you and headers just don't get along do you? Though that said, I hate them too. Any chance you can mail me the full page top to bottom? Failing that, as long as you'r validation page doesn't actualy display anything change your headers to includes.
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
I got to call it a night, if you don't get it resolved please feel free to mail me the two php pages and I'll go through them tomorrow once I get the chance. Although I am certain I leave you in better hands than mine. -
Why does this display only 1 result?
Muddy_Funster replied to TeddyKiller's topic in PHP Coding Help
For my part your welcome, keep up the good fight -
you could try escaping it $quote = '\''; str_replace($quote,''',$var);
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
meh! leave me be, it's an illnes you both know that I ment account.php -
I know there is a better way of doing it than swaping out the character, but I can't remember how it's done at the moment. In about 9 ours I'll be back at my development machine, I should have some stock code I can post that does something similar to what you are trying. I do hope however that someone else has the answer on how to set the sql_escape_character to somthing different.
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
what output did you get from the echos on the session variables and the $user_area_location? does the header work if you put it as header('Location: acount.php'); -
going back to your OP you could try cahnging your delete query to a truncate one: $qry = "TRUNCATE attacktype_table WHERE encid = '".$encid."'"; Just a thought.
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
does the $user_area_location echo out ok? if it does try poping the exit after the die line and see if it brings up the link. I think if you echo out the session variables you should find that they are ok. that it is getting stuck on the header line makes me assume that the logig for the if statement is working ok. -
you get a single quote ( ' ) and you get a back tick ( ` ) subtle difference to the eye, but could be all it takes to throw your str_replace out. Incidently, would you mind telling us why you need to str_replace this, there may be alternatives.
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
ooops, my bad! remove the . after the $user_area_location and see if that helps. -
you sure it's not a back tick?
-
With the echo line, enclosing the main part of the text in the single quote allowed the native double quotes to be echoed for the html tag. the dots before and after the variable are links. They tell the echo line to add what's after the dot to the output as well. While you can echo "this $var" it is better to echo "this ".$var I'm going to come at this from a different angle and see what we get. <?php if(isset ($_POST['submit'])){ ... ?> <form name="register" action="register.php?submit='true'" type="submit" method="post"> ahh well, even better, you got it yourself. Nice one good luck with the rest.
-
Why is logged in status not getting set?
Muddy_Funster replied to twilitegxa's topic in PHP Coding Help
your header looks a little off, try header("Location: $user_area_location."); exit; and see if that works. -
for this to work: $sql = "UPDATE stats SET total='$stats[1]', overall='$stats[0]' where username = '$user' you will need to connect the variables to the statement using "." eg. $sql = "UPDATE stats SET total='.$stats[1].', overall='.$stats[0].' where username = \''.$user'\''; I also quoted your $user variable as it looks as though it is a sting. if you can run the above query using the following: mysql_query($query) or die (mysql_error(); and let us know what, if any, errors come back it would help a lot.
-
ok, fist let's tidy up the echo line... if (empty($_POST['email1'])) { echo '<p class="error">'.$errorBlank.'</p>'; } else { $email1 = mysql_real_escape_string($_POST['email1']); } } Now look at your form input for the email fields. On the form the names are "email" and "email2", you are POSTing "email1" instead of "email". Fix this to your preference and give it another shot.
-
Why does this display only 1 result?
Muddy_Funster replied to TeddyKiller's topic in PHP Coding Help
your echo would be the third from the bottom, and he is using $first_record to say that "if this is the first record, echo out the field names at the top of the table, otherwise just fill in the values". Effectivly that's a full substitute code he's got there. -
loop through array and check against db query
Muddy_Funster replied to isedeasy's topic in PHP Coding Help
I think you are looking for... $filter = "achievment"; $query = "SELECT id, users, date FROM rep WHERE rep.users = ".$filter; $result = mysql_query($query) or die (mysql_error)); $rep_array = mysql_fetch_assoc($result); that's generic, and you will need to establish a connection to the database prior to including that on a page. It will however give you an array containing the following array fields: $rep_array['id'] $rep_array['users'] $rep_array['date'] and be populated ony with the records that match the filter. You could effectivly just echo that list to get the same results as checking through your array (from what I gather you said you were doing with it, I may have gotten things wrong). If that's not what you are looking for let me know, I'll be happy to work through it some more with you. -
Exclude 1 ID from sql query while using an OR
Muddy_Funster replied to xXREDXIIIXx's topic in MySQL Help
Basicly, and rightly, he's saying to use brackets: SELECT gameid, title FROM games WHERE ((gameid != '6' AND gen1 = 'First Person Shooter') OR (gameid != '6' AND gen2 = 'Online')) ORDER BY RAND( ) LIMIT 5 Should do what you want it to. In the future I would recomend that if you are making any multi-part where clause just bracket it up (you can even put brackets round a single WHERE (a = b) if you fancy it. -
I'm not following you....you're saying you can NOT use union syntax because you MUST use MySQL?
-
well you got me. I'm not much into making things pretty. how about removing the z-ref' - don't recall sing that in any pages I have worked with (goes for nothing by the way)
-
ok, change the form to: <form method="post" action="register.php?$submit='true'" type="submit"> and see if that helps. And just to keep everyone happy here, I was going to wait untill I knew it worked before going into the mechanics of it but basicly I am atempting to alter the code so that, the first time it is loaded the $submit variable is, as PFM.. rightly said, not set and so the validation code is skiped, however, click the button on the form and it reloads the page at the same time assigning the value of 'true' to the $submit variable which will then be registered and run the validation code. I just preffer to have a solution before I explain how it fixes things...just in case it doesn't.
-
and your point is caller?
-
try removing the position variable alltogether and see what happens