-
Posts
1,842 -
Joined
-
Last visited
Posts posted by marcus
-
-
Make:
$num = mysql_num_rows($res);
This:
$num = mysql_num_rows($result);
-
Hotness prevails, works like a charm
-
Ken your method works great if the string is alone by itself, but how would I go about checking the whole string to see if any of the "bad-script" filters are in the string and only replace the "bad-script" words.
<?php $filter = array('onmouseout', 'onmouseover', 'onclick', 'ondblclick', 'onkeydown', 'onkeypress', 'onkeyup', 'onmousemove', 'onmouseup', 'onmousedown' ); $replace = ""; $string = "I like using onmouseUp"; echo preg_replace("/$filter/i",$replace,$string); ?>
-
How can I use preg_replace to replace any of the "bad values," in my "bad values" array, and use case insensitivity.
So: THIS = thIs.
<?php $js_filter_array_bad = array( 'onmouseout', 'onmouseover', 'onclick', 'ondblclick', 'onkeydown', 'onkeypress', 'onkeyup', 'onmousemove', 'onmouseup', 'onmousedown' ); $replace = ""; $string = "onMouseOut"; echo preg_replace("|$js_filter_array_bad|iU",$replace,$string); ?>
-
Make your own functions so you only need to call it once.
-
SELECT * FROM SIPRODUCTTABLE
-
htmlspecialchars();
-
if($_SESSION['email'] == base64_decode($_GET['need']) {
TO:
if($_SESSION['email'] == base64_decode($_GET['need'])) {
Never ended the IF statement.
-
$hour = date("G"); $reset = 18; //military hour if($hour >= $reset){ echo "RESETTTING\n"; }else { echo "FAIL."; }
-
$sql = "SELECT * FROM `tbl` WHERE `this`='that'"; $res = mysql_query($sql) or die(mysql_error()); echo "<select name=\"name\">\n"; while($row = mysql_fetch_assoc($res)){ echo "<option value=\"$row[field1]\">$row[field2]</option>\n"; } echo "</select>\n";
-
I'm giving all the information need before outputting it to an image.
-
Try:
<?php $img_handle = ImageCreate (230, 20) or die ("Cannot Create image"); $back_color = ImageColorAllocate ($img_handle, 0, 10, 10); $txt_color = ImageColorAllocate ($img_handle, 233, 114, 191); ImageString ($img_handle, 31, 5, 5, "My first Program with GD", $txt_color); header("Content-type: image/png"); imagepng($img_handle); ?>
-
ORDER BY row1,row2 ASC
-
Code please.
-
Show code?
-
<input type="hidden" name="submission" value="1">
if($_POST['submission']){ // YAY! }else { // -fail- }
-
When you use the str_replace, instead of the \n do you just get n? Because since you're using mysql_real_escape_string it should remove all slashes to prevent an injection.
-
Just do:
if($name){ //success }else { //failure }
-
Lol.
$string = "*C* your text here *C*"; $explode = explode("*C*",$string); $text = $explode[1]; echo str_replace($text,"",$string);
that would remove "your text here"
-
Try using nl2br to display the data.
-
Instead of:
if (isset($_POST)) {
Do:
if($_POST['submitButtonName']){
-
print_r($files);
is that even an array
-
That's javascript.
<script language="Javascript"> function addBold(){ form.textarea.value += "[b]Your text here[/b]" } </script> <form name="form"><input type="button" value="Bold" onClick="addBold()"><br> <textarea name="textarea" cols="30" rows="14"></textarea><br><input type="submit"> </form>
-
What is it putting into the database, and what does your string hold?
having problems with a simple mail script...
in PHP Coding Help
Posted
You're going to need more header information to send to some of those free mail servers.