Philip
Staff Alumni-
Posts
4,665 -
Joined
-
Last visited
-
Days Won
20
Everything posted by Philip
-
Looks like you have some mismatched brackets. You could easily tell/fix this by indenting your code properly. See how it looks indented: <?php if($_POST['confirm']){ if($_POST['attack']=="Attack"){ $i = $row['attack']; $money = $row['money']+100; if($i > "20"){ echo "<script>alert('You have damaged the Drone. He currently has 20 health.');</script>"; } } if($i<"20"){ echo "Hi"; } } if($_POST['attack']=="Flee"){ echo "Hi"; } } // extra ?>
-
Yeah, good ole SMF Just a note though, a work around is using [nobbc][/nobbc] tags (which adds a lot of extra typing) So, $SomeArray[color=red][nobbc][0][/nobbc][/color] turns into $SomeArray[0]
-
[SOLVED] Basic VERY basic WYSIWYG Editor for smileys
Philip replied to TheFilmGod's topic in Miscellaneous
Yeah it's under Profile -> Look and Layout -> [X] Show WYSIWYG editor on post page by default? -
[SOLVED] Basic VERY basic WYSIWYG Editor for smileys
Philip replied to TheFilmGod's topic in Miscellaneous
Why wouldn't it? OP stated he didn't need formatting, just inserting smilies, yes? And take a look at the demo (again, I know it's older but it still works) http://alexking.org/projects/js-quicktags/demo/index.html -
[SOLVED] Basic VERY basic WYSIWYG Editor for smileys
Philip replied to TheFilmGod's topic in Miscellaneous
Take a look at (it should get you started... even though it is an older entry): http://alexking.org/blog/2003/06/02/inserting-at-the-cursor-using-javascript -
Ummm.... There's a lot wrong bud. Sorry. Missing a ' $so = str_replace(?>', "", $so); Why are you using eval - that should be a last resort thing: $so = str_replace('eval($_G', '$some($_G', $so); Deprecated (ereg): $some= ereg_replace('eval', 'echo', $some);
-
Well, it's technically in the forum guidelines (#5) but you know how many people read that
-
Trying to str_replace an entire mail message.
Philip replied to scrubbicus's topic in PHP Coding Help
Well a few things... str_replace allows for an array input of search and an array of replacement values. You might want to look into that instead. And when echo'ing the return value of a function, the function must not be inside of quotes. You have: echo "str_replace($k,$v,$body) <P />"; It would need to be: echo str_replace($k,$v,$body)." <P />"; // or echo str_replace($k,$v,$body)," <P />"; -
My apologies for the misunderstanding. It is very possible to do this without ajax - as long as they use a submit button and it isn't a live update (there has to be a fresh page loaded) See my post above for a code example.
-
Pretty easy with AJAX - if you want it live (i.e. Click the checkbox and it instantly disappears) But... I think I might have misread your post when I moved it. If you want it when they click the submit button, you need to use a foreach loop to get each checkbox value.... if(isset($_POST['item']) && is_array($_POST['item'])) { // there were some items selected: foreach($_POST['item'] as $item) { // your query string here... } } And the syntax past that is based on how you have your DB setup.
-
If it comes up with "supplied argument is not a valid MySQL result resource", that means your query failed. You need to echo mysql_error(); on the line after your query to see why it is failing.
-
From Cnet: Who seriously wants a browser that is based off of a Microsoft engine - when they can't even properly render valid W3C markups?
-
Why not just do: $item[1]['type'] = "weapon"; $item[1]['name'] = "Knife"; $item[1]['damage'] = 5; $item[1]['durability'] = -1; $item[1]['reqlvl'] = 1; $item[1]['level'] = 1; $item[2]['type'] = "armour"; $item[2]['damage'] = 5; $item[2]['durability'] = -1; $item[2]['reqlvl'] = 1; $item[2]['level'] = 1;
-
okay you got me there. FF and IE cannot do that. I have wished I could break a FF tab out into its own window via drag/drop or rightclick or something. But what you CAN do in FF (not IE or chrome) is drag the tab to your desktop and it saves it as a shortcut. Alternatively, you can drag a FF tab to chrome or IE and it will load up the link in those browsers. Can't do it the other way around! You either have one or the other, not both. I'd prefer to have the ability like Chrome where I can drag it to open a new window. Also, as roopurt said, being able to close the one tab or plug-in that is killing your browsing experience is just freakin' awesome. The fact that I can forcefully kill a process/tab and it won't crash the whole browser makes my life a lot easier. And the update process in Chrome is so much better than FF or IE. I like when things update themselves to a stable version (of course you can change that) automatically, and when I launch my browser it instantly opens to a browser window, not a freaking popup asking if I want to update some random plugin I rarely use. I think Chrome to me now, is what Firefox was to IE when I first switched. Something new and exciting, a lot faster, and cool new features not found in the other one. And Avant? That's like saying Flock is the best browser for everyone.
-
$result - "SELECT userstatus FROM gb_login WHERE username='$username' AND password='$password' LIMIT 1;"; Notice something wrong there?
-
Done. Don't even get me started on IE6.
-
Its because your query failed. echo mysql_error() to see why.
-
I smell a lawsuit.
-
I think its because of this line of code $user_query = mysql_query("SELECT FROM users WHERE username = {$username}"); which seems fine to me. EDIT: also it logs me in fine. just doesnt pull the information from the second query.. Hopefully you won't keep the die in there - and will switch to a better error handling system after development is done. You need to have single quotes around a non-numerical value in a mysql query. mysql_query("SELECT FROM users WHERE username = '{$username}'");
-
[SOLVED] Fatal error: Call to undefined function paginate()
Philip replied to jigsawsoul's topic in PHP Coding Help
Are you including the page that has the paginate function, because it seems like its not being included -
[SOLVED] Getting the content between to characters
Philip replied to neddry's topic in PHP Coding Help
Using the datetime class you can extract any part you need: $d = date_create('2009-08-12T01:00:00+01:00'); echo date_format($d, 'm/d/Y -- H:i:s P'); Look at date for the formatting strings.... Edit: (this is given you're using PHP 5.2+, if not there are still ways to do it - but this class has made it easier) -
pleeeease help with shipping code? $shipping[0] =
Philip replied to JoAnne_B's topic in PHP Coding Help
Tells you a lot about what is wrong! But range probably isn't what you're looking for anyways - since it returns an array of values, and not checking to see if a value is in that range. What are the first 2 lines of the if/elseif way? -
array_intersect perhaps?
-
Dude, chill out. It has barely been 30 minutes and you're already bumping your thread. Have you tried echo'ing your query and seeing if anything is amiss there?