Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. Oh and as stated by AlexWD, ereg it's depreciated, but you could also do this change if(ereg("(.*)\.(jpg|bmp|jpeg|png|gif)", $row['file_name'])) { to if(in_array(strtolower(substr($file_name, strrpos($file_name, '.')+1)),array("jpg","jpeg","bmp","png","gif"))){ EDIT: oops forgot about uppercase (updated)
  2. That approach only works by loading everything into memory.. as salathe stated it could be a very large file, also this has been solved !
  3. As your code only loads the same image over and over.. it makes little sense!
  4. above post was updated: what are you trying to do.. as your likely using a bucket load of memory with zero gain!
  5. Maybe it had a heart attack ? try adding more memory to the computer.. (a LOT more) What are you even trying to do ? other than kill apache!
  6. read about utf8_encode in the manual should help
  7. I have a PDF of that book, a friend also learning PHP asked me for help him, the problem is if the books to complex then its overwhelming, if its too basic then your unprepared for problems. if that said on first review the book seams quite good.
  8. Very true, if this is a one off then your be okay but for less memory usage try <?php $handle = fopen("theFile.txt", "r"); if ($handle) { $data = ""; while (!feof($handle)) { $line = fgets($handle, 4096); if (preg_match('/\'([^\']*)\'/', $line, $regs)) { $data .= $regs[1]; } } fclose($handle); echo $data; }
  9. for the iphone/ipod you need mp3 for audio and mp4 for video.. so all your get is a video without the video feed that takes up less space and has less playability (as it won't work on the shuffles etc) So the conversion is pointless !
  10. Okay well the email didn't send (but i think you got that) Have you setup your mail server ? check your PHP.ini settings for the SMTP server
  11. That would be quite a trim.. you could get the string position of the first and last quote and use substring to pull it out, but should work (Untested) <?php $lines = file('theFile.txt'); $data = ""; foreach ($lines as $line) { if (preg_match('/\'([^\']*)\'/', $line, $regs)) { $data .= $regs[1]; } } echo $data;
  12. try this <?php $to = $_POST['to']; $title = $_POST['title']; $message = $_POST['message']; $email = $_POST['from']; if(mail($to, $title, $message, "From: $email")){ echo "Email sent to $to from $email, with the title $title."; }else{ echo "Email Failed"; } ?> Note: variables inside single quotes wont get parsed
  13. Update this line if($rscat['Category_Id'] == $_REQUEST['id']) $title = htmlentities($rscat['Category_text']); to if($rscat['Category_Id'] == $_REQUEST['id']) $title = "Some other text - ".htmlentities($rscat['Category_text']); of couse this doesn't affect your default title
  14. Cool, The script looked fine, however it maybe worth getting a local copy.. (it easy to install /start /stop) if you use WAMPSERVER2. Can you click topic solved (bottom left)
  15. I mainly write my own, I don't have one to hand but i have a module that's due for an update, so i'll probably add it to that..
  16. aweb, questions should be asked here.. here's the answer update $CatList .= "<a href=\"categories.php?id=".$rscat['Category_Id']."\">".htmlentities($rscat['Category_text'])."</a>"; to $CatList .= "<a href=\"categories.php?id=".$rscat['Category_Id']."\">".htmlentities($rscat['Category_text'])."</a>"; $CatList .= "<hr size=\"1\" class=\"intleftboxhr\" />"; please note that i escaped the quotes " becomes \"
  17. No a mod re-write wouldn't effect permission but it could cause strange behaviour, for example you could have a mod that points images/(.*)\.gif to images.php?name=\1 while that could be intended for only one folder it would effect all! including http://www.gamerecoil.com/Sara/PHP6/images/ I don't think that is the case but i wouldn't rule it out. But testing on another server or locally would help rule out most coding errors.
  18. Well its seams to be Permission problems also if you try something unPHP related you still get problems ie, try to open a image form here http://www.gamerecoil.com/Sara/PHP6/images/ EDIT: oh boy.. its 3:15am i to be up in 4 hours!.. I'm going to get some sleep.. try another host.. also look at wampserver, xxamp as you can run them from windows client, (nice for dev testing)
  19. @Jnerocorp, your correct but i don't believe thats what his asking for .. when you post from a form the URL the form goes to (VIA GET) is like index.php?id=10&name=blar, Now while you can change the URL in an anchor tag, its not really possible to do it in a form.. but you could have a javascript collect all the form elements and build up a query and use windows.locations= "page.php?"+buildUpQuery
  20. Because you get the title at the start, thus the variable is set note the line if($rscat['Category_Id'] == $_REQUEST['id']) $title = htmlentities($rscat['Category_text']); EDIT: i missed a closing } in the above code it should be <?php $servcat=mysql_query("select * from We_ServiceCategory_tbl "); if(mysql_num_rows($servcat)>0) { $CatList = ""; while($rscat=mysql_fetch_assoc($servcat)) { if($rscat['Category_Id'] == $_REQUEST['id']) $title = htmlentities($rscat['Category_text']); $CatList .= "<a href=\"categories.php?id=".$rscat['Category_Id']."\">".htmlentities($rscat['Category_text'])."</a>"; } }?>
  21. I ran a test on your site and didn't get Pass 4! Also it seams like a permissions problem, as the images are being listed but are not viewable.. set the permission to 755, (as some hosts providers lock out 777 access) EDIT: are you using any mod-rewrite's ?
  22. Build the list at the very start and store it in a variable like this, (also you store the title) <?php $servcat=mysql_query("select * from We_ServiceCategory_tbl "); if(mysql_num_rows($servcat)>0) { $CatList = ""; while($rscat=mysql_fetch_assoc($servcat)) { if($rscat['Category_Id'] == $_REQUEST['id']) $title = htmlentities($rscat['Category_text']); $CatList .= "<a href=\"categories.php?id=".$rscat['Category_Id']."\">".htmlentities($rscat['Category_text'])."</a>"; }?> later on the page you can insert the list like this //HTML - Insert List <?php echo $CatList; ?>
  23. Okay.. I don't see how your getting Can you confirm this please also just as a double check, try adding some checkpoints ie (note the pass #) if (!empty($name) && !empty($score) && !empty($screenshot)) { echo "pass1<br>\n"; if ((($screenshot_type == 'image/gif') || ($screenshot_type == 'image/jpeg') || ($screenshot_type == 'image/pjpeg') || ($screenshot_type == 'image/png')) && ($screenshot_size > 0) && ($screenshot_size <= GW_MAXFILESIZE)) { echo "pass2<br>\n"; if ($_FILES['screenshot']['error'] == 0) { echo "pass3<br>\n"; // Move the file to the target upload folder $target = GW_UPLOADPATH . $screenshot; if (move_uploaded_file($_FILES['screenshot']['tmp_name'], $target)) { echo "pass4<br>\n"; EDIT: Oh and your Welcome
  24. Humm.. okay.. i guessed wrong.. can you also do a var_dump($_POST);
×
×
  • 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.