Jump to content

drisate

Members
  • Posts

    805
  • Joined

  • Last visited

Everything posted by drisate

  1. For drop down menues you have to test if your var is equal to the option value and use SELECTED in your option tag print ("<select name='contact_time' class='FormEntry' id='contact_time'> <option value='0'"); if ($contact_time=="0"){echo "selected";} print (">(Select a time)</option> <option value='Anytime'"); if ($contact_time=="Anytime"){echo "selected";} print (">Anytime</option> <option value='Morning'"); if ($contact_time=="Morning"){echo "selected";} print (">Morning</option> <option value='Afternoon'"); if ($contact_time=="Afternoon"){echo "selected";} print (">Afternoon</option> <option value='Evening'"); if ($contact_time=="Evening"){echo "selected";} print (">Evening</option> </select>");
  2. Use mktime() $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); $lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y")); $nextyear = mktime(0, 0, 0, date("m"), date("d"), date("Y")+1);
  3. sorry i don't understand a thing from your question lol "I need to add all the right hand most numbers that have the same $bolID." For your record i hate dealing with hard to understand questions hehe try to explain your self a little more.
  4. you can use vars only in double quotes ;-)
  5. I am not sure i understand your question ... But if i am right your asking how to use info from your db Well first you have to connect your self then you can use this if you would like only one info $username = @current(@mysql_fetch_assoc(@mysql_query("SELECT username FROM accounts WHERE id='$id'"))); echo "Your username is $username"; or you can do it like this is you wana have more then one info from your row or from multiple rows $check = mysql_query("SELECT * FROM accounts WHERE id='$id'") or die (mysql_error()); if (mysql_num_rows($check)) { while ($member= mysql_fetch_array($check)) { echo "Your username is $member[username] and your age is $member[age]"; } }
  6. No do it in one query like this: [...]Match1=%s, ConMatch1='UPDATE IT TO THIS'[...]
  7. Hey guys i was wandering if you could share an easy global output/imput filtrer for $_POST $_GET and $_REQUEST Something i can use at the bigining of my script that will protect the page from any xss or what so ever ...
  8. lol yeah np hehe I attached the class to this message But from what i can see it's a one by one output filtrer ... how to make it global? (Thx Wesf90 but the XSS class seams to be alot more secure and since this is for a very big project i need to be the moste secure i can.)
  9. wow thanks thats gona help :-) you found 2 new places If you have a sec take a look at http://www.phpfreaks.com/forums/index.php/topic,183166.0.html That could solve every problems one shot. I got the php error solved Fatal error: Call to undefined function: htmlspecialchars_decode() in /home/versatil/public_html/demo/forum.php on line 252 But to have the target=/ stoped i am gona have to restructure the page >.< I really appreciate this. Thanks corvex :-) I hope my board can one day be as good as all the others out there.
  10. What do you think :-) http://versatilebb.com/demo User: admin Password: demo
  11. How to use this http://www.phpclasses.org/browse/package/2189.html?download=zip On a global scale for $_POST $_GET and $_REQUEST With out doing it one by one for every outputs
  12. I don't think i can adapt eval for this anyway ... eval seams to work only when you know the data $string = 'cup'; $name = 'coffee'; $str = 'This is a $string with my $name in it.'; echo $str. "\n"; eval("\$str = \"$str\";"); echo $str. "\n"; but in this case i have no idea what they can type ... [ php ]include("whatever.php");[ /php ]
  13. Really ... intresting. I am making a header foother add-on for my board and this couls be great :-) so how would you do it? i have the <textarea name=\"header\" rows=\"28\" cols=\"74\">".htmlspecialchars_decode($header)."</textarea> iserted into $hf=mysql_query("UPDATE $dbprefix"."_header_foother SET header='".htmlspecialchars($_POST['header'])."', foother='".htmlspecialchars($_POST['foother'])."'", $db) or die ('OUPS >.< : '.mysql_error()); and to retreave it i use if (!function_exists("htmlspecialchars_decode")) { function htmlspecialchars_decode($string, $quote_style = ENT_COMPAT) { return strtr($string, array_flip(get_html_translation_table(HTML_SPECIALCHARS, $quote_style))); } } $hf=mysql_query("SELECT * FROM $dbprefix"."_header_foother", $db); while ($hf_info=mysql_fetch_array($hf)){ $header_info = htmlspecialchars_decode($hf_info['header']); } if(stristr($_SERVER[php_SELF].$_SERVER[QUERY_STRING], '/fr/') === FALSE) {$lang="EN";}else{$lang="FR";} if ($style[name]=="gray/blue"){$style[name]="gray-blue";} $styled_logo = "flash/vbb_logo_".$style['name'].".swf"; $header_info = str_replace("[FLASH-LOGO]", $swf, $header_info); echo $header_info; How can you insert php with out having it executed in plain text?
  14. I was wandering if it's possible to insert php code into a mysql table and retreave it later to execute it ...
  15. Currently your imput looks like this <input id="test 0" onchange="javascript:saveValue(0,this.value)" name="T1" size="20"><br> <input id="test 1" onchange="javascript:saveValue(1,this.value)" name="T2" size="20"><br> <input id="test 2" onchange="javascript:saveValue(2,this.value)" name="T3" size="20"><br> <input id="test 3" onchange="javascript:saveValue(3,this.value)" name="T4" size="20"><br> <input id="test 4" onchange="javascript:saveValue(4,this.value)" name="T5" size="20"><br> <input id="test 5" onchange="javascript:saveValue(5,this.value)" name="T6" size="20"><br> Make your self a hidden input and put in it the number of feilds created then loop them with a for loop
  16. Drink a cofee and smoke a cig everytime you start coding and that will never happend hehe
  17. When encryted the password looks diffrent. To check if a password is the same ecrypt the sended password and compare them $new_pass=md5($_POST[pass]); if ($new_pass == $the_pass_in_the_DB) ...
  18. The reason why you canot insert a JS var in a PHP code is because The first thing executed by the server is the PHP so the JS var will appear emty entile the PHP is done.
  19. you can insert a php var in a js code but canot insert a js var in a php code.
  20. Thanks using you logic it gave me what i needed to find this function catOptions2($parent2, $level2=0) { $sql2 = "SELECT cat_id, cat_name FROM categories WHERE parent_cat_id = '$parent2' ORDER BY cat_name"; $res2 = mysql_query($sql2) or die(mysql_error()); $str2 = ''; while (list($id2, $name2) = mysql_fetch_row($res2)) {if ($level2!="0"){$level3=$level2-1;}else{$level3=$level2;} $indent2 = str_repeat("<img height='20' alt='' src='image/vide.gif' width='20'>", $level3); if ($level2!="0"){$this="<img alt='' src='image/arbre.gif'>";} if ($level2%2 == 1){$bk="bgcolor='#DEDFDF'";} $str2 .= "<table border='0' cellpadding='0' cellspacing='0' width='100%'> <tr> <td width='80%' $bk><font size='1' face='Verdana'>$indent2$this<img alt='$id2' src='image/categ_logo.gif'> $name2</font></td> <td width='20%' $bk> </td> </tr> </table>\n"; // now call itself to get subcats of this cat $str2 .= catOptions2($id2, $level2+1); unset($this);unset($bk); } return $str2; } It's brilliant hehe it calls him self for subcategorys
  21. Just before the INSERT INTO MySQL command
  22. lol when your message is posted and abbout to be entered in the database
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.