-
Posts
1,008 -
Joined
-
Last visited
Everything posted by spiderwell
-
error trapping, its the bulk of a programmer's work. its 10% building a script and 90% preventing users from breaking it
-
The biggie - comparing values and if a < b statement
spiderwell replied to mrt003003's topic in PHP Coding Help
i cant work out the class/planet/ship deal. mostly because of this statement: Depending on what type of ship is added (Class 1-4 ship) its corresponding Class is determined. The planet table is different though as it can have any number of Class 1 - 4 ships. -
blank page should only occur if no data has returned from the initial select statement, i suspect you pressed back in your browser and have tried to delete the same record
-
yeah there will be one that checks against only ' slash or space' , thats all you will need.
-
and I should have looked closer at your code and my answer, remove the extra mysql_fetch_array($result); between the first 2 echo "Hi" statements
-
lots of nasty nested if conditions! ...anyway the registration goes to fff.html, back tracking from there I noticed you store your SQL INSERT statement in $aql, and then execute using $sql, typo perhaps?
-
a feel a regular expression expert will answer this, i have a convoluted solution that would use explode() to split string to an array using the slash as the delimiter, then do a ctype_alpha() check on each element of array. I so need to learn reg exp...
-
i dont think you need the ($adopt == $row['id']) for a start as that will always be true anyway. you missed out passing the record set result to $row <?php $con = mysql_connect("localhost","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("a8784hos_adopts", $con); $adopt = $_POST['adoptid']; $uniquecode = $_POST['uniquecode']; $result = mysql_query("SELECT uniquecode, id FROM id WHERE id='$adopt'"); mysql_fetch_array($result); while ($row = mysql_fetch_array($result)){ if ($uniquecode == $row['uniquecode']){ mysql_query("DELETE FROM id WHERE id='$adopt'"); echo 'Done! <br/><br/><a href="tester.php">Go back....</a>'; } else { echo 'Bad unique code. <br/><br/><a href="tester.php">Go back....</a>'; } } ?>
-
Reset button for JavaScript generated rows
spiderwell replied to LittleSmilingMonster's topic in PHP Coding Help
this should be in the javascript section really... but it looks like the appended fields also have their own form tags, which makes them seperate forms ergo wont be affected by the reset button from the original form -
surely its been blocked for a reason, and you should be working not trolling besides wouldnt a proxy site do the job for you? or they all blocked too?
-
stop sending them. you need to contact your hosts and find out how many mails can be sent at once/over a period or ask them about how to do large mailshots for your site. most hosts have some kind of throttle on number of emails sent as standard anti spam procedures
-
which of the function shoud I use first?
spiderwell replied to rashidfarooq's topic in PHP Coding Help
if it was me, I would use htmlspecial chars first then escape, but I have no idea if that is correct, and if indeed there is a correct order -
how do you want the submission done, via a form or a link usually link is GET method, and you will see the info in the address bar form is POST method, and info is hidden when sent.
-
you are trying to retrieve using $_POST which is POST method in a form, but the long urlstring is using $_GET method. also raw form data into sql statement leaves you wide open to sql injection
-
Trying to Validate Input, but it's not working
spiderwell replied to VinceGledhill's topic in PHP Coding Help
thats because there is no condition attached to the output of that message, you should put it and the sql execution inside the if($_POST['submit']) so it only executes when the form has been posted -
ok sorry i misread your part about the update, so ignore that part , revert the query back. what does it actually echo in the image tag when you view source?
-
i dont think you need the single quotes around the echo statement, but you do need them around the $data array, try $PlayerDefaultSkin = $data['PlayerDefaultSkin']; <img src="skins/<?php echo $PlayerDefaultSkin; ?>.png"> also check src path, is it /skins/ or just skins/
-
hehe beat me to it! also i thought you had to use || not OR or can you use either
-
Trying to Validate Input, but it's not working
spiderwell replied to VinceGledhill's topic in PHP Coding Help
the reason that !$somevariable doesn'tt work is because that is the test for that variable to be false not say empty, which is what I think is what you are trying to do. change say if(!$username) to if($username == '') -
Possible to insert a space between a lowercase and capital letter?
spiderwell replied to Jeffro's topic in PHP Coding Help
some sort of regular expression should do it, but I'm no good at those, someone will be along soon how is good at them -
i would suggest its done in ajax or jquery, which is essentially javascript. java would work but i hate that crap
-
one of the 3 or more is incorrect, otherwise it would connect, I suggest contacting the universtiy network administrator to confirm the name of the server, username and password. are you muddling the server name with the name of the database?
-
im lost to what help you are after now, as you stated you have stopped completely with it, and so im not sure what you are trying to do any more!
-
its all ok really, only thing i would change myself is name the form fields differently rather than just input7,input8 etc
-
yes ALTER will allow you to do that