Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. STOP bumping every few minutes you should wait atleast an hour.. break the line up into multiple lines your spot the error if you haven't found the problem i'll post the solution in an hour! EDIT: tip the problem is here 's' => $value === null ? 0 : strlen(serialize($value)) break up into 2-4 lines of code tip #2 ()
  2. preg_match("/^[\ 0-9a-zA-Z\_\n-]+$/m",$_POST['choices']); edit: added the multiline switch and moved the - to the end
  3. change if ( (!check()) && ($_POST['uname']=='root' && $_POST['passwd'] == 'qwerty')) { to if ( ($_POST['uname']=='root' && $_POST['passwd'] == 'qwerty')) {
  4. change if (!check() || $_POST['uname']!='root') { to if ( (!check()) && ($_POST['uname']=='root' && $_POST['passwd'] == 'qwerty')) { However if they just type admin.htm their be in to the "admin.htm" area. change the admin.htm to a admin.php file and add something like this to the start <?php session_start(); if($_SESSION['stat']!='ok') { die("No Access"); } ?>
  5. this isn't php now is it! ? i don't think their is a mute all! each has their own, JS can mute js, Flash can mute its own flash etc
  6. your recieve the string ie so $theSring = "the man well" then your break it up into an array ie $theArray = explode(" ",$theString); // the " " means space delimitor so <?php $theArray = explode(" ",$_POST['theText']); print_r($theArray); ?> for the 2nd one, well you probably best storing the posted data, in a file or Database, then when the other client machines refesh it displays that data stored!
  7. yes that would affect the memory requirements, but the loop isn't needed, try my post its short and simple,
  8. Keep it simple <?php $badwords = array("bad1","bad2","bad3"); $post = "this is a bad1 word."; $post = str_ireplace($badwords,"****",$post); echo $post; ?>
  9. encrypted PDF's have some padding on some of the blocks that make up the PDF, you could check for them, as for removing your need to read in the whole file and decrypt the the blocks (RC4).
  10. Send Via form POST, fsocket or CURL..
  11. to explain on papaface post (which i recommend), personally i store the userid in a session ie $_SESSION['UserID'], then have a routine to check the access level (if that level allows me to edit others records then i accept the get "UserID=xxx" from the URL if not i ignore it.. and set theID back to the UserID ie <?php start_session(); $isAdmin = checkaccess($_SESSION['UserID']); if (isset($_GET['UID']) && ($isAdmin === true)) { $uID = $_GET['UID']; }else{ $uID = $_SESSION['UserID']; } //Load records with $uID as the userID function checkaccess($userID) { //search user ID in mySQL and get UserLevel if ($userlevel == 1)//whatever is the Admin Level { return true; }else{ return false; } } ?>
  12. yes only JPEG see the 2 //#######BELOW tags, you can update to work with PNG and GIF & WBMP (not windows but wireless) check php.net for imagecreatefromgif & imagecreatefrompng for examples $Original_Name = basename( $_FILES['Image1']['name']); $target_path = 'images/'; $New_Image_Name = 'pic'. $ID . $EXT_united; // load image and get image size //#######BELOW $img = imagecreatefromjpeg( $_FILES['Image1']['tmp_name'] ); $width = imagesx( $img ); $height = imagesy( $img ); $percent = 0.5; $new_width = $width * $percent; $new_height = $height * $percent; // create a new temporary image $tmp_img = imagecreatetruecolor( $new_width, $new_height ); // copy and resize old image into new image imagecopyresized( $tmp_img, $_FILES['Image1']['tmp_name'], 0, 0, 0, 0, $new_width, $new_height, $width, $height ); // save thumbnail into a file //#######BELOW imagejpeg( $tmp_img, "{$target_path}{$New_Image_Name}" );
  13. lol, no need to be sorry your helping either way.. just becareful of using the word "only", theirs all ways another way to skin a cat as a side know i personally think AJAX is over used now days (common problem with buzz words)
  14. // load image and get image size $img = imagecreatefromjpeg( $_FILES['Image1']['tmp_name'] ); $Original_Name = basename( $_FILES['Image1']['name']);
  15. Erm.. No! you can use Javascript / AJAX but you can also use frames or try this nav <table id="Menu_contentdiv"> <tr> <td><a href="?pages=index">main</a></td> <td><a href="?pages=encyclopaedia">encyclopaedia</a></td> <td><a href="?pages=restaurants">restaurants</td> <td><a href="?pages=search">search</td> <td><a href="?pages=information">information</td> </tr> </table> <?php // you could do //include $_GET['pages'].".php"; // but you have loss control switch($_GET['pages']) { case "encyclopaedia": include "encyclopaedia.php"; break; case "restaurants": include "restaurants.php"; break; case "search": include "search.php"; break; case "information": include "information.php"; break; default: include "home.php"; break; } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <link href="style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="Maindiv"> <div id="Hoofdingdiv"> <div id="Hoofding_contentdiv">Chun is conquering the banners .</div> </div> <div id="Menudiv"> <div id="Menu_contentdiv"> <?php include("navigatie.php");?> </div> </div> <div id="Middendiv"> <div id="Midden_leftmenudiv"><?php include("left_content.php"); ?></div> <div id="Midden_contentdiv"><?php include("main.php"); ?></div> <div id="Midden_rightmenudiv"><?php include("right_content.php"); ?></div> </div> <div id="Onderdiv"></div> </div> </body> </html>
  16. turn off open_basedir in the httpd.conf file, also check the open_basedir in the php.ini file
  17. the kerning isn't very good with imagettftext, your need to write them line by line adjusting the Y coordinate, Quick example (untested) <?php $text = wordwrap($text, 15, "\n", true); $textArray = explode("\n",$text); $gap = 0; foreach($textArray as $theText) { $gap = $gap + 30; //whaever! Imagettftext($im, $font_size, $angle, $x, $y+$gap, $color, $font, $theText); } ?>
  18. what are you trying to do ? write to a remote server ?
  19. No i can't see the problem.. you have the AND in the SQL! Post some example data with expected results
  20. Opps reverse that SELECT * FROM `catalog` WHERE `Year_Start` <= $YEAR AND `Year_End` >= $YEAR 2001 <= 2004 = true 2008 >= 2004 = true
  21. you can't unset the function try this <php function _remove($name) { $name = _sql_escape($name); unset($_SESSION[''.$name.'']); } ?> or try this <php unset(_getVar($name)); function _getVar($name) { $name = _sql_escape($name); return $$_SESSION[''.$name.'']; } ?> **untested
  22. try this <?php $smilies = "tongue.gif|smile.gif|angry.gif|123|456|789|ABC|DEF|GHI"; $sArray = explode("|",$smilies); echo "<table border=\"0\">\n<tr>\n"; $c = 4; //Rows foreach($sArray as $Key => $Value) { if(!($Key % $c)) echo "</tr><tr>"; echo "<td>$Value</td>"; } if(!($Key % $c)) echo "</tr>"; echo "</table>\n"; ?>
  23. why cant you do SELECT * FROM `catalog` WHERE `Year_Start` > $YEAR AND `Year_End` < $YEAR ?
  24. Okay fine try this.. <html> <head> <title>Securimage Test Form</title> </head> <body> <?php if (!empty($_POST)){ //form is posted include("securimage.php"); $img = new Securimage(); $valid = $img->check($_POST['code']); if($valid == true) { echo "<center>Thanks, you entered the correct code.</center>"; } else { echo "<center>Sorry, the code you entered was invalid. <a href=\"javascript:history.go(-1)\">Go back</a> to try again.</center>"; } } ?> <form method="POST"> Username:<br /> <input type="text" name="username" /><br /> Password:<br /> <input type="text" name="password" /><br /> <!-- pass a session id to the query string of the script to prevent ie caching --> <img src="securimage_show.php?sid=<?php echo md5(uniqid(time())); ?>"><br /> <input type="text" name="code" /><br /> <input type="submit" value="Submit Form" /> </form> </body> </html> you should beable to update the text colour but this is pretty basic stuff, and should be posted in third party section
  25. try this RewriteRule ^(\w+)\w+)$ index.php?p=$1&c=$2 [L,QSA] i assume your always going to have
×
×
  • 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.