Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Well, the . is there because it continues the variable... other wise you'll just get the last word + a space. [code]<?php $line = "/ban KingPhilip For being dumb"; // -action|username|reasons $line_exploded = explode(" ", $line); //explode line if($line_exploded[1] = "/ban") { // if action is ban $username = $line_exploded[2]; // get username unset($line_exploded[1]); // unset the username and action unset($line_exploded[2]); array_keys($line_exploded); // renumber the array $reason = ""; foreach($line_exploded as $var) { $reason. = $var; // put the reason back together with spaces $reason. = " "; } mysql_query("UPDATE `user_table` SET `ban`='true' `ban_reason`='".$reason."' WHERE `username`='".$username."'") or die(mysql_error()); // run mysql query } ?> [/code]
-
This should work... somebody else will probably have a better solution. [code]<?php $line = "/ban KingPhilip For being dumb"; // -action|username|reasons $line_exploded = explode(" ", $line); //explode line if($line_exploded[1] = "/ban") { // if action is ban $username = $line_exploded[2]; // get username unset($line_exploded[1]); // unset the username and action unset($line_exploded[2]); array_keys($line_exploded); // renumber the array foreach($line_exploded as $var) { $reason. = $var." "; // put the reason back together with spaces } mysql_query("UPDATE `user_table` SET `ban`='true' `ban_reason`='".$reason."' WHERE `username`='".$username."'") or die(mysql_error()); // run mysql query } ?> [/code]
-
Probably because they just updated the forum software.
-
[code]<form action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">[/code] Try that instead.
-
Do you have a link to the site (you can PM if you want), or can you show the form code?
-
Sigh... you know some little kid is going to shoot himself with that one day.... I couldn't imagine seeing the amount of yellow warning stickers on the packaging. I mean, they already have to have "Be careful, cardboard box edges might be sharp enough to give you a papercut! You cannot sue us for that now!" Ridiculous (the warning labels they must put on stuff now a days) But I must admit, the gun does look quite sexy =)
-
If you echo them, does it show all of the data?
-
music = '$c needs an extra ' music = '$c'
-
[quote author=PC Nerd link=topic=118758.msg499536#msg499536 date=1168232331] should there also be an option after 3 days of having no nswer to a thread, to mark in red text, instead of the usual colors, so that people realise its been overlooked????? [/quote] Well, what about those people that 'forgot' to close it? Personally, my eyes would get sore after a while, of trying to look through to see if it had been solved or not. [i]Normally[/i], people won't go past the 2nd page (which normally are topics a day old)
-
Try using mysql_fetch_array and a while loop.
-
Yeah, agreed with HuggieBear. You have a login/admin login whenever I'm already logged in...
-
Umm, I just noticed... why do you have your database login info in hidden fields?
-
I like it better. Would the buttons up in the top right "colorize" whenever your mouse rolled over them? (example of this, bottom of the forum php/mysql/w3c buttons)
-
http://www.providenceri.com/publicworks/road_closings.php <- messy (I'm not sure if it is supposed to look like that... or if it is my browser) If I enter in something wrong (for the table) [code] Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/mywebf5/public_html/readybydesign/data2b.php on line 89 Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /home/mywebf5/public_html/readybydesign/data2b.php on line 440[/code] If I enter in something wrong for the database: [code]Unable to connect to the database[/code] You're going to want to have it check to see if there is a database and a table, before trying to display information off of them. Agreed with businessman332211, you need some style (but you discussed that ;)) And for this code: [code]$sql ="SELECT * FROM road WHERE id = ". $HTTP_GET_VARS["id"]; $result = mysql_query($sql); $row = mysql_fetch_array($result); <?php echo $row[""]?> <?php echo $row["id"] ?> <?php echo $row["date"] ?> <?php echo $row["street_nmbr"] ?> <?php echo $row["street"] ?> <?php echo $row["description"] ?> <?php echo $row["street_nmbr1"] ?> <?php echo $row["cross_street1"] ?> <?php echo $row["street_nmbr2"] ?> <?php echo $row["cross_street2"] ?> <?php echo $row["event_name"] ?> <?php echo $row["impact"] ?> <?php echo $row["restriction"] ?> <?php echo $row["reason"] ?> <?php echo $row["begindate"] ?> <?php echo $row["enddate"] ?> <?php echo $row["startHour"] ?> <?php echo $row["startMinutes"] ?> <?php echo $row["startAP"] ?> <?php echo $row["endHour"] ?> <?php echo $row["endMinutes"] ?> <?php echo $row["endAP"] ?> <?php echo $row["zip"] ?> <?php echo $row["term"] ?> <?php echo $row["visible"] ?> <?php echo $row["type"] ?> <form enctype="multipart/form-data" name="road" method="post" action="<?php echo $PHP_SELF; ?>"> <input name="id" size="6" type="int" value=""><br> <input name="date" size="23" type="timestamp" value=""><br> <input name="street_nmbr" size="7" type="blob" value=""><br> <input name="street" size="24" type="blob" value=""><br> <input name="description" size="99" type="blob" value=""><br> <input name="street_nmbr1" size="4" type="string" value=""><br> <input name="cross_street1" size="19" type="blob" value=""><br> <input name="street_nmbr2" size="11" type="string" value=""><br> <input name="cross_street2" size="19" type="blob" value=""><br> <input name="event_name" size="17" type="blob" value=""><br> <input name="impact" size="29" type="blob" value=""><br> <input name="restriction" size="32" type="blob" value=""><br> <input name="reason" size="123" type="blob" value=""><br> <input name="begindate" size="23" type="timestamp" value=""><br> <input name="enddate" size="23" type="timestamp" value=""><br> <input name="startHour" size="6" type="blob" value=""><br> <input name="startMinutes" size="6" type="string" value=""><br> <input name="startAP" size="6" type="string" value=""><br> <input name="endHour" size="6" type="blob" value=""><br> <input name="endMinutes" size="6" type="string" value=""><br> <input name="endAP" size="6" type="string" value=""><br> <input name="zip" size="4" type="blob" value=""><br> <input name="term" size="5" type="string" value=""><br> <input name="visible" size="5" type="string" value=""><br> <input name="type" size="14" type="blob" value=""><br> <input type="Submit" name="submit" value="Submit"> <input type="reset" name="Clear" value="Clear"> </form> <?php echo $row["id"] ?> <?php echo $row["date"] ?> <?php echo $row["street_nmbr"] ?> <?php echo $row["street"] ?> <?php echo $row["description"] ?> <?php echo $row["street_nmbr1"] ?> <?php echo $row["cross_street1"] ?> <?php echo $row["street_nmbr2"] ?> <?php echo $row["cross_street2"] ?> <?php echo $row["event_name"] ?> <?php echo $row["impact"] ?> <?php echo $row["restriction"] ?> <?php echo $row["reason"] ?> <?php echo $row["begindate"] ?> <?php echo $row["enddate"] ?> <?php echo $row["startHour"] ?> <?php echo $row["startMinutes"] ?> <?php echo $row["startAP"] ?> <?php echo $row["endHour"] ?> <?php echo $row["endMinutes"] ?> <?php echo $row["endAP"] ?> <?php echo $row["zip"] ?> <?php echo $row["term"] ?> <?php echo $row["visible"] ?> <?php echo $row["type"] ?> <form enctype="multipart/form-data" name="road" method="post" action="<?php echo $PHP_SELF;?>"> <input name="id" size="6" type="int" value="<?php echo $row["id"] ?>"><br> <input name="date" size="23" type="timestamp" value="<?php echo $row["date"] ?>"><br> <input name="street_nmbr" size="7" type="blob" value="<?php echo $row["street_nmbr"] ?>"><br> <input name="street" size="24" type="blob" value="<?php echo $row["street"] ?>"><br> <input name="description" size="99" type="blob" value="<?php echo $row["description"] ?>"><br> <input name="street_nmbr1" size="4" type="string" value="<?php echo $row["street_nmbr1"] ?>"><br> <input name="cross_street1" size="19" type="blob" value="<?php echo $row["cross_street1"] ?>"><br> <input name="street_nmbr2" size="11" type="string" value="<?php echo $row["street_nmbr2"] ?>"><br> <input name="cross_street2" size="19" type="blob" value="<?php echo $row["cross_street2"] ?>"><br> <input name="event_name" size="17" type="blob" value="<?php echo $row["event_name"] ?>"><br> <input name="impact" size="29" type="blob" value="<?php echo $row["impact"] ?>"><br> <input name="restriction" size="32" type="blob" value="<?php echo $row["restriction"] ?>"><br> <input name="reason" size="123" type="blob" value="<?php echo $row["reason"] ?>"><br> <input name="begindate" size="23" type="timestamp" value="<?php echo $row["begindate"] ?>"><br> <input name="enddate" size="23" type="timestamp" value="<?php echo $row["enddate"] ?>"><br> <input name="startHour" size="6" type="blob" value="<?php echo $row["startHour"] ?>"><br> <input name="startMinutes" size="6" type="string" value="<?php echo $row["startMinutes"] ?>"><br> <input name="startAP" size="6" type="string" value="<?php echo $row["startAP"] ?>"><br> <input name="endHour" size="6" type="blob" value="<?php echo $row["endHour"] ?>"><br> <input name="endMinutes" size="6" type="string" value="<?php echo $row["endMinutes"] ?>"><br> <input name="endAP" size="6" type="string" value="<?php echo $row["endAP"] ?>"><br> <input name="zip" size="4" type="blob" value="<?php echo $row["zip"] ?>"><br> <input name="term" size="5" type="string" value="<?php echo $row["term"] ?>"><br> <input name="visible" size="5" type="string" value="<?php echo $row["visible"] ?>"><br> <input name="type" size="14" type="blob" value="<?php echo $row["type"] ?>"><br> <input type="Submit" name="submit" value="Submit"> <input type="reset" name="Clear" value="Clear"> </form> [/code] it could use a lot of cleaning up, but thats just my opinion ;)
-
I do like that support page about why sites are shutting down :P I didn't see that when I first visited the site lol
-
Nice, I have 19" and 15" LCDs that I use. Your wires look like mine, I need to well, clean them up a bit ;)
-
I'm sorry, but I hate that scrolling thing off on the side... especially since it isnt even smooth, and it jumps back to the beginning Theres too much blank space at the top
-
You left out the break; on the last one. default: echo "<img src=\"../images_site/mods-gen.jpg\" title=\"GEN\" />"; break; //Add additional cases }
-
Reviews brought up a 404 error. You have a style issue in FF2.0 on the checkout page (this is probably caused by you using a higher resolution than most. Remember to always check your site on a 1024x768 at least) Screenshot: http://img71.imageshack.us/img71/9384/checkoutdo7.jpg Also, you need a warning to have the user go and turn on/enable JS if it isn't already. I turned off JS for a second and couldnt checkout.
-
Try adding another echo right after it, to see if it is that echo or mysql statement. Also add an "or die(mysql_error())" after the mysql statement
-
Learn something new everyday :) Thanks.
-
I would be more than willing to help, but could you describe what the error is? And as genericnumber said, you need to use != FALSE not !==FLASE
-
I think it might be better for them to have normal font (or more normal font) but you have to type it in backwards. I agree that that captcha is hard to read (yes, I know you can request a new image.. but they are all pretty hard to read) Example: code: KingPhilip you type in: pilihPginK (looks weird :P)
-
I Need Help Understanding Some Strange PHP code!
Philip replied to mmtalon's topic in PHP Coding Help
I'm probably wrong. This is a little bit over my head ;)