-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
I assume $list is a built up array then just before you output your adding $list[0]=$leadrow; have you tried adding $list[0]=$leadrow; before building the array ?
-
$_FILES[userfile] is displaying no value.
MadTechie replied to amorphous4u's topic in PHP Coding Help
turn on error_reporting, error_reporting(E_ALL); did you submit the form? -
Halo 3 Saved Film HD Recording Service - Testers Needed
MadTechie replied to HaLo2FrEeEk's topic in Beta Test Your Stuff!
I have posted code that's wrong, I think most of us have, but we try not to repeat that mistake, the fact the exact same code (above) has been proven to be wrong in many post, kinda makes us wonder why you keep posting it! -
Just use single quotes to stop the parsing $target_path = 'images\cat\images'; in anycase the path should be $target_path = 'images/cat/images';
-
basically use the force download the script should be in an accessible folder but it should be set to read from the inaccessible folder
-
$_FILES[userfile] is displaying no value.
MadTechie replied to amorphous4u's topic in PHP Coding Help
The results seam kinda weird as $userfile = $_POST['userfile']; echo "1".$userfile; shouldn't give you the file path! try this <FORM ENCTYPE="multipart/form-data" ACTION="" METHOD=POST>Upload your photo: <INPUT NAME="userfile" TYPE="file"> <input type="submit"> </form> <?php $userfile = $_FILES['userfile']['name']; echo "1".$userfile; if((!empty($_FILES["userfile"])) && ($_FILES['userfile']['error'] == 0)) { //Check if the file is JPEG image and it's size is less than 350Kb $filename = basename($_FILES['userfile']['name']); $ext = substr($filename, strrpos($filename, '.') + 1); if (($ext == "jpg") && ($_FILES["userfile"]["type"] == "image/jpeg") && ($_FILES["userfile"]["size"] < 350000)) { //Determine the path to which we want to save this file $newname = dirname(__FILE__).'/upload/'.$filename; //Check if the file with the same name is already exists on the server if (!file_exists($newname)) { //Attempt to move the uploaded file to it's new place if ((move_uploaded_file($_FILES['userfile']['tmp_name'],$newname))) { echo "It's done! The file has been saved as: ".$newname; } else { echo "Error: A problem occurred during file upload!"; } } else { echo "Error: File ".$_FILES["userfile"]["name"]." already exists"; } } else { echo "Error: Only .jpg images under 350Kb are accepted for upload"; } } else { echo "Error: No file uploaded"; echo "2".$filename; } ?> -
Okay first remove all of the $thisPage= (not from the IF's just anywhere your setting it then add this to the start of the blog.php, services.php etc etc etc <?php $thisPage=substr(basename(__FILE__), 0, -3);?> that will set $thisPage to blog or services etc etc etc Now when you include nav.php it will read $thisPage correctly
-
well the matches should be okay, could you echo out a full header and from line, and post it here
-
Okay lets echo it just before we use it <?php echo "*****'$thisPage'****"; if($thisPage=='blog'){ echo '<span class="current">blog</span>'; }else{ echo '<a href="blog.php">services</a>'; } if($thisPage=='services'){ echo '<span class="current">services</span>'; }else{ echo '<a href="services.php">services</a>'; } if($thisPage=='about'){ echo '<span class="current">about</span>'; }else{ echo '<a href="about.php">about</a>'; } if($thisPage=='contact'){ echo '<span class="current">contact</span>'; }else{ echo '<a href="contact.php">contact</a>'; } if($thisPage=='policy'){ echo '<span class="current">policy</span>'; }else{ echo '<a href="policy.php">policy</a>;'; } ?> Also from your live page <div class-"formShell"> should be <div class="formShell">
-
-
your nav.php page doesn't seam to have any closing php tags (?>) but lots of opening one!
-
$ifile = an array. so that file won't exist
-
That code doesn't make much sense! convert newline to Break, then convert break to newline! does $row['text'] have the \n in ? try echo "<textarea>{$row['text']}</textarea>"; and post back what you get
-
it sounds like your creating a login system, if so then your need to control the access level via permissions you setup in the database, please note this is not the same as the filesystem permission, as all users will be using the same account name for accessing the files via PHP,
-
Can't you just used something like this <?php // Checks if string is a URL // @param string $url // @return bool function isURL($url = NULL) { if($url==NULL) return false; $protocol = '(http://|https://)'; $allowed = '[-a-z0-9]{1,63}'; $regex = "^". $protocol . // must include the protocol '(' . $allowed . '\.)'. // 1 or several sub domains with a max of 63 chars '[a-z]' . '{2,6}'; // followed by a TLD if(eregi($regex, $url)==true) return true; else return false; } ?>
-
try this Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} ^.+-(\d+?)-.*?\.html$ [NC] RewriteRule ^.+-(\d+?)-.*?\.html$ myfile.php?hid=$1 [NC]
-
Just tested my code.. worked fine on WinXP (not saying much I know) no errors
-
The + & * in the $allowed are messing it up, maybe change it to ([a-z0-9]([-a-z0-9]*?[a-z0-9])?) i'll move this to RegEx section
-
can you post your .htaccess file
-
in the manual. Yes the function the user defined!, being the second parameter! of course this "should" work! <?php $files = glob('200_*.jpg'); array_walk($files,'myunlink'); function myunlink($t) { unlink($t); } ?>
-
try RewriteRule ^.+-(\d+?)-.*?\.html$ myfile.php?hid=$1 [NC]
-
Where did you read that ? ToonMariner function looks sound to me (not a Glob fan.. but I am starting to be )
-
no, but it shouldn't be too hard should **totally untested** <?php function RecursiveUnlink($dir,$regEx='200_') { if(!$dh = @opendir($dir)) { return; } while (false !== ($obj = readdir($dh))) { if($obj == '.' || $obj == '..') { continue; }elseif(preg_match('/^'.$regEx.'*?\.jpg$/i', $obj)) { unlink($obj); } } closedir($dh); return; } ?>
-
[SOLVED] preg_replace_callback and callback function
MadTechie replied to anarchoi's topic in PHP Coding Help
welcome Can you click topic solved please (bottom left) -
[SOLVED] addition issue on alphanumeric value
MadTechie replied to Walker33's topic in PHP Coding Help
Can you click topic solved please (bottom left)