-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
Use tabs to make your coding more resourceful to you.
if($thing == 'jim'){ if($harold != $thing){ echo "Harold doesn't like " . $thing; }else { echo "Harold loves " . $thing; } }else { if($greg != $thing){ echo "Greg doesn't like " . $thing; }else { echo "Greg loves " . $thing; } }
-
-
Er. Mod rewrite?
RewriteEngine On RewriteRule ^articles/([^*]*)/([^*]*)/([^*]*)-([^*]*)\.html$ /articles.php?year=$1&month=$2&article=$3&page=$4 [L]
-
$sql = "SELECT * FROM `table` WHERE `this`='that'"; $res = mysql_query($sql) or die(mysql_error()); if(mysql_num_rows($res) > 0){ echo "Row exists"; }else { echo "Row does not exist"; }
-
Those smilies make you look stupid, haha.
-
echo 'hello my name is ' . $name;
-
form.elements[i].checked=true
change form with your form name.[/code]
-
Did you change the name of the checkbox to list[] ?
-
name=\"list[]\"
print_r($_POST['list']);
alt:
foreach($_POST['list'] AS $email){ echo $email . "<br />\n"; }
-
-
mysql_query("UPDATE `playerranks` SET `player_points`=`player_points` + $Amount WHERE `player_name`='{$Player_Name}'") or die(mysql_error());
-
You said it yourself
switch($this){ case 'this' echo "this"; break; default: echo "OPO!PO"; }
-
$Price = number_format($Price); //back to normal
echo number_format(10800); //10,800
-
$Price = str_replace(",","",$Price);
-
The frame URL is: http://ff.phpsnips.com/incl/loadNewURL.php
-
And your problem?
-
$sql = "SELECT * FROM `urls` ORDER BY RAND()"; $res = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($res); echo "<frame src=\"{$row['url']}\" frameborder=\"0\" width=\"500\" height=\"auto\" scrolling=\"yes\">your browser does not support frames</frame>\n";
-
<SCRIPT LANGUAGE="JavaScript"> function anyCheck(form) { var total = 0; var max = form.checkboxes.length; for (var idx = 0; idx < max; idx++) { if (eval("document.form.checkboxes[" + idx + "].checked") == true) { total += 1; } } if(total >= 2) { return TRUE; }else { alert("Please select atleast two boxes")} } } </script> <form method="post" name="test" onSubmit="anyCheck(this.form)"> 1<input type=checkbox name="checkboxes[]"> <br>2<input type=checkbox name="checkboxes[]"> <br>3<input type=checkbox name="checkboxes[]"> <br>4<input type=checkbox name="checkboxes[]"> <br>5<input type=checkbox name="checkboxes[]"> <br>6<input type=checkbox name="checkboxes[]"> <br>7<input type=checkbox name="checkboxes[]"> <br>8<input type=checkbox name="checkboxes[]"> <br>9<input type=checkbox name="checkboxes[]"> <input type="submit"> </form>
you could try that.
-
Try:
explode("\n", $string); # $string being the variable exploded
-
Javascript can read PHP as JS.
If the file you include is *.php then it will be read as JS.
-
$checkboxes = $_POST['checkboxes']; if(count($checkboxes) >= 2){ //allow }else { echo "you must select 2 or more to continue"; }
<input type="checkbox" name="checkboxes[]" value="1"> <input type="checkbox" name="checkboxes[]" value="2"> <input type="checkbox" name="checkboxes[]" value="3"> <input type="checkbox" name="checkboxes[]" value="4">
-
<? echo $name ?>
that's shorthand too
-
Chyea, my bad. Had the ending numbers incorrect.
-
my code is non existent.
[SOLVED] Can I inser value from mypage.html?src=[value] into a link?
in PHP Coding Help
Posted
No, you don't need a .php extension. You can have a mime-type set to make html viewed as php.