Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. The found URL's are $link ie foreach ($matches[1] as $link){ echo file_get_contents($link); }
  2. 1. Double posting is against the rules 2. you don't need to open every link find an item 3. you have all the functions you need (are technically need to repeat what you have)
  3. 1. if its desperate, you should post in the freelance section 2. this is basically a double post [link] 3. leaching is one thing but leaching email addresses..
  4. You can Manage your Database via most IDE's Adobe Dreamweaver, Zend Studio, NuSphere PhpED to name but a few!
  5. change echo getGrades($average); to if(isset($_POST['grades'])){ echo getGrades($average); }
  6. I get that But this suggests that the field doesn't exist until its been approved, This would be easier if you had a schema or some samples!
  7. Okay when you post from a form.. even is the value of a field is empty the field is still set so it ISSET change the ISSET's to !empty (not empty) so if(isset($_POST['searchid']) || (isset($_POST['pagename']))) becomes if(!empty($_POST['searchid']) || (!empty($_POST['pagename'])))
  8. try this <form method='post' action=''> <?php $average= 0; $values = array('grades' => array_fill(0, 10, 0)); if(isset($_POST['grades'])){ $values = $_POST; $grade=$_POST['grades']; $total = 0; foreach($grade as $grades){ $total += $grades; } $average = $total/count($_POST["grades"]); } for($n=0;$n<10;$n++){ echo "Grade ".($n+1).":<input name=\"grades[$n]\" type=\"text\" value = \"{$values['grades'][$n]}\" />"; } ?> <input type='Submit' name='Submit' value="Submit" /> </form> <?php echo getGrades($average); function getGrades($grade){ if ($grade >= 89.5){//is A return 'A'; }elseif ($grade >= 79.5){ return 'B'; }elseif($grade >= 69.5){ return 'C'; }elseif ($grade >= 59.5){ return 'D'; } return 'F'; } ?>
  9. Okay can we break this down a little, I don't get what's with FieldID 4964744 and 4953960.. Which one is for what ?
  10. Okay well without more info I'm out of guesses then...
  11. First off. Welcome to PHP Freaks Now when posting code please use the code tags (#) Now on to the code.. SESSIONS (as these work I'm break down WHY they work) Okay we set the SESSIONS FontFam, FontColor & FontSize to their respective values, ie the SESSION FontFam = the POSTed FontFam $_SESSION['FontFam'] = $_POST['FontFam']; $_SESSION['FontColor'] = $_POST['FontColor']; $_SESSION['FontSize'] = $_POST['FontSize']; Now we set $myFontFam to the SESSION FontFam etc $myFontFam = $_SESSION['FontFam']; if ($myFontFam == 'SanSerif') { $myFontFamilyNames = "Arial, Helvetica, sans-serif"; } else { $myFontFamilyNames = '"Times New Roman", Times, serif'; } $myFontColor = $_SESSION['FontColor']; $myFontSize = $_SESSION['FontSize']; $myText = $_POST['TextArea']; OKAY.. now lets take a look at cookies COOKIES Okay we set the COOKIES font, size & color to their respective values, (humm not the same as SESSION) if (isset($_POST['SavePref'])) { setcookie('font', $_POST['FontFam'], time() + 60); setcookie('size', $_POST['FontSize'], time() + 60); setcookie('color', $_POST['FontColor'], time () + 60); } Now we set $myFontFam to the COOKIE FontFam etc .. wait one second.. has COOKIE FontFam been set ? $myFontFam = $_COOKIE['FontFam']; if ($myFontFam == 'SanSerif') { $myFontFamilyNames = "Arial, Helvetica, sans-serif"; } else { $myFontFamilyNames = '"Times New Roman", Times, serif'; } $myFontColor = $_COOKIE['FontColor']; $myFontSize = $_COOKIE['FontSize']; $myText = $_POST['TextArea']; So we can fix it by either setting $myFontFam = $_COOKIE['font']; OR (PREFERRED) Setting $_COOKIE['FontFam'] instead of setting $_COOKIE['font'] I hope that helps
  12. With out seeing the ajaxpage script i'm going to guess So shouldn't $division = $_GET['division']; be $division = $_GET['content'];
  13. $grade=$_POST['grades'] should be $grade=$_POST['grades']; note the ;
  14. Found 3 syntax errors (see comments) <?php if ($_SERVER['REQUEST_METHOD'] != "POST") { include "search.html.php"; }else{ if(isset($_POST['searchid']) || (isset($_POST['pagename']))) { $sql = "SELECT * FROM `pages` WHERE "; } if(isset($_POST['searchid'])) { $sql .= "'searchid' = (".$_POST['searchid'].")"; //ADD ".." } if(isset($_POST['searchid']) && (isset($_POST['pagename']))) //ADDED ) { $sql .= " and "; } if(isset($_POST['pagename'])) { $sql .= "'pagename' = (".$_POST['pagename'].") ";//ADD ".." }else{ $sql .= "You must enter search terms"; } include "searchres.html.php"; } ?> EDIT: cleaned up formatting
  15. I'm sorry but I don't understand the logic, can you post some sample record entries, which are UnApproved, Approved, Denied.. PS i am going to move this to the MySQL Topic
  16. Dude, Learn to debug your code instead of demanding other do it for you. The problem isn't that hard, PS learn how to create functions and debug your SQL queries
  17. Okay the smile(); function isn't working comment out the line //smile();
  18. @lakshmiyb: please create your own thread, no hi-jacking of posts here
  19. Can you just add the file 274670.php, without any changes (just for testing)
  20. See attached i have zipped 3 files a font, antispam.php and 274670.php open 274670.php and test [attachment deleted by admin]
  21. try this, I have been a little lazy here with the RegEx's <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.realgm.com/"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $html = curl_exec($ch); curl_close($ch); $meta = array(); preg_match_all('/<meta[^>]*?name\s*=\s*(["\'])([^\1>]*?)\1[^>]*?content\s*=\s*(["\'])([^\3>]*?)\3/sim', $html, $result, PREG_SET_ORDER); foreach($result as $M){ $meta[$M[2]] =$M[4]; } preg_match_all('/<meta[^>]*?content\s*=\s*(["\'])([^\1>]*?)\1[^>]*?name\s*=\s*(["\'])([^\3>]*?)\3/sim', $html, $result, PREG_SET_ORDER); foreach($result as $M){ $meta[$M[2]] =$M[4]; } var_dump($meta); ?>
  22. It has to be at the VERY top, with nothing before it.
  23. LOL, it was just an over sight.. dame.. you should see some of mine.. So solved ? if so please click topic solved (bottom left) Yes I always read it. EDIT: try this update echo'<form method="post" action="deleteImage.php" enctype="multipart/form-data">'; echo'<ul>'; if(empty($files)) echo"There are no images"; //add this foreach($files as $file)
  24. looks good to me DavidAM, just 1 typo <input type="submit" name="submit" value="Delete Checked"/> should be echo '<input type="submit" name="submit" value="Delete Checked"/>';
  25. you need to escape the inner quotes (\") ie echo "<form action=\"\"><textarea readonly=\"readonly\">http://fotosnap.net/images/$image_name</textarea> </form>";
×
×
  • 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.