Jump to content

DeanWhitehouse

Members
  • Posts

    2,527
  • Joined

  • Last visited

Everything posted by DeanWhitehouse

  1. My way is slightly flawed, if the width is less than the height.
  2. I changed the code
  3. What the hell, is that your code? Do this <?php error_reporting(E_ALL); $findimage = mysql_query ("Select * FROM `phpbb_files`") or die(mysql_error()); echo mysql_num_rows($findimage); while ($row = mysql_fetch_array($findimage)){ $image ="uploads/"; $image .= $row['shortname']; echo "<img src=\"".$image."\" alt=\"Image can not be found\" />"; } ?> And tell us what it says
  4. Ok, you will need these two functions first of all http://uk3.php.net/manual/en/function.imagecolorat.php http://uk3.php.net/manual/en/function.getimagesize.php second one only if you don't know the image size And then what i would do is loop using a for loop, and have it go pixel by pixel ( across the top) and when it reaches the edge of the image get it to go down one, etc. $image_x = 200; $image_y = 200; $y = 0; for($x = 0;$x <= $image_x;$x++ { if($x == $image_x) { $x = 0; $y += 1; } if($y == $image_y) $y = 0; $color = imagecolorat ($image,$x,$y); $y ++; } Slightly improved
  5. Going on that idea also add echo mysql_num_rows($findimage); under the query to see how many rows it finds
  6. Use a loop and go pixel by pixel checking the colour, although i am unsure if the GD library can do this
  7. Yes, use a span tag on them with some css to change the colour
  8. No it shouldn't <?="anything"?> The above requires short tags to be on is like doing <?php echo "anything";?>
  9. It will say something then, what does it say?
  10. Try changing SELECT notes.note from notes INNER JOIN notes on custid.notes OUTER JOIN customer.id where username='{$_SESSION['username']}'"); to SELECT notes.note from notes INNER JOIN notes on custid.notes OUTER JOIN customer.id WHERE customer.username='".$_SESSION['username']."'");
  11. <?php error_reporting(E_ALL); $findimage = mysql_query ("Select * FROM `phpbb_files`"); while ($row = mysql_fetch_array($findimage)){ $image ="./uploads/"; $image .= $row['shortname']; echo "<img src=\"".$image."\" alt=\"Image can not be found\" />"; } ?> Try that
  12. Can you not just make an image map ? Or do i not understand what you are trying to achieve?
  13. <?php $Questions["ch1"] = "ch1"; $Questions["ch2"] = "ch2"; $Questions["ch3"] = "ch3"; $Questions["ch4"] = "ch4"; $Questions["ch5"] = "ch5"; $Questions["ch6"] = "ch6"; $Questions["ch7"] = "ch7"; $Questions["ch8"] = "ch8"; $Questions["ch9"] = "ch9"; $Questions["ch10"] = "ch10"; $Questions["ch11"] = "ch11"; $Questions["chDontCountMe12"] = "ch12"; $Questions["ch13"] = "ch13"; $PositiveFirstCriteria = 0; for($i = 1; $i <= 13; $i++) { if(strlen(trim($Questions["ch".$i])) > 0) { $PositiveFirstCriteria++; echo "<p>Count: ". $i .", ". $PositiveFirstCriteria ."</p>"; } } ?> Just changed one thing
  14. Just noticed as well, if you have 13 questions then you will need to change your < (less than) to <= (less than or equal to) otherwise it will skip number 13, although a for loop is better suited for looping through an array like you are.
  15. Blade is not being condescending or negative (at least I don't think he's trying to be), but form validation in PHP takes a toll on your sanity depending on how long the form gets. My site has a form with 15 fields to fill in, which is 77 lines of HTML/PHP, and a registration validator that is 157 lines, so about 200 lines of code for a 15 field registration page. That not why i said it, if i had loads of fields i would make a way to loop through them. We are giving up our free time to help people with php problems, we are not here just to write code for you. Laziness doesn't benefit you in learning a language.
  16. It will work, i have used it many times
  17. try $Questions['ch'.$count] the dot is concatenation (i think that is how it is spelt) it is used to join two strings together.
  18. Ok that's nice, try asking in the freelance section and i am sure someone will be happy to make you one at a small price.
  19. I have made a login, register, and logout script. Please don't lie then, it makes us assume you know enough to just use the logic we tell you. I'm afraid we won't just hand you the code, please post in the freelance section or attempt to create the code yourself and when you hit a problem we will help
  20. Now be honest did you write the login or did you copy and paste from the internet (or similar), because i have given you all the information you would need if you wrote a login script using a db and sessions, and if you haven't used sessions i have given a link to a site on how to protect pages using sessions.
  21. I thought you said you wrote a login script?
  22. so if the file was like //config.inc.php file $db_name = "name"; //etc... then you could do $file = fopen("config.inc.php"); echo $db_name; that should do it i think, not 100% so test it out
  23. fread, fwrite, fopen and fclose, but not in that order
  24. On my CMS i started i used a file called config.inc.php which just stored variables like the database details.
  25. Ok, then how did you write a registration and login script ? Look at this kinda tutorial which covers login and protected for pages http://djw-webdesign.awardspace.com/code.php?snippet=9
×
×
  • 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.