Jump to content

deansaddigh

Members
  • Posts

    440
  • Joined

  • Last visited

    Never

Everything posted by deansaddigh

  1. How can i check if the field region is equal to yes, because i want to display a pic if it is. ($row['region']) Thanks in advance
  2. OK, ill reevaluate the image, i didn't think it was stretched, just cropped. Ill take another look.
  3. We had some problems, as far an i know i have erradicated all traces of it, (HOPEFULLY) Using this http://www.google.com/safebrowsing/diagnostic?site=http://www.languageschoolsuk.com Its saying the site is safe. Hopefully it is.
  4. Can you guys take alook atwww.languageschoolsuk.com Just putting some finishing touches to it, please ignore schooldetails.php thanks in advance guys.
  5. Ok guys well thanks for all the help. Much appreciated. Ill get on with sorting it out
  6. So just to clarify, you believe my ftp is compromised, in away thats a relief. I dont understand what you mean by the www.languageschoolsuk.com domain, are you saying its hard to read and i should change it ?
  7. Thanks for your help, ill change ftp credentials asap exactly like what u said. Ive got mysql real escape stings on everything. Thats prob not enough im guessing, but i dont really know about security that much, Any advice
  8. They have litterally changed every single file to instead of be the code i have on a page, to his. I have no idea how to fix it, i have emailed fasthosts see what they say
  9. Well this is epic http://www.languageschoolsuk.com/ IM so blimin annoyed now, ive done everything i can to prevent this, and this is what happens.
  10. Im guessing the code is to long for people to try and understand, so im gonna ask another question, does anyone know any easy to implement scripts that will do pagination for me?
  11. hi there, yes i have its the pagination logic most definitely as there are 12 rows that it should be bringing back. Thanks :0
  12. Can some one see if they can spot any mistakes in my pagination for results page. It only seems to be bringing back 3 results which is incorrect there are more. basically im trying to display my results over several pages. Heres my code // how many rows to show per page - 18 Would equal 3 rows of 6 photos. Below code within while loop specifies the amount of photos per row in the table. $rowsPerPage = 3; // by default we show first page $pageNum = 1; // if $_GET['page'] defined, use it as page number if(isset($_GET['page'])) { $pageNum = $_GET['page']; } // counting the offset $offset = ($pageNum - 1) * $rowsPerPage; $query = "SELECT course.course_id, course.name AS course_name, course.level, course.price, course.info, course_type.type, school.school_id AS school_id, school.name AS school_name, school.street, school.town, school.city, school.county, school.region, school.postcode, school.country, school.school_facts, school.general_info, school.school_facilities FROM school_course JOIN course ON school_course.course_id = course.course_id JOIN school ON school_course.school_id = school.school_id JOIN course_coursetype ON course.course_id = course_coursetype.course_id JOIN course_type ON course_coursetype.course_typeid = course_type.course_typeid WHERE region = '$region' AND course_type.course_typeid ='$coursetype' AND town='$town' AND country='$country' ORDER BY school_name ASC" . " LIMIT $offset, $rowsPerPage"; //Use this query below $result = mysql_query($query, $conn) or die ("Unable to perform query: " . mysql_error()); //echo out all details i want //rest of pagination //******Joes Pagination continued // how many rows we have in database $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " <a href=\"$self?page=$page\">$page</a> "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">« Prev</a> "; $first = " <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">Next »</a> "; $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } echo '<br/>'; echo '<br/>'; //If there is only one page then do nothing. if ($maxPage ==1) { } //Else show user page information and links to browse multiple pages. else { // print the navigation link echo '<p class ="pagination">'; echo $first . $prev . $nav . $next . $last; echo '</p>'; } Thanks in advance
  13. oopsy, it should be schools, not student photos for a start on the sql count. Seems to work now. Is the way i have done the pagination ok?
  14. I have code for my pagination but its working incorerectly as you can see from this page http://www.languageschoolsuk.com/view_all_schools.php Some pages are empty when using the pagination. heres the code //pagination $rowsPerPage = 5; $pageNum = 1; if(isset($_GET['page'])) { $pageNum = $_GET['page']; $pageNum = trim($pageNum); } $offset = ($pageNum - 1) * $rowsPerPage; // select school details based on school id $query = "SELECT image_school.image_id, image_school.school_id, school.name AS school_name,school.school_id, school.street, school.town, school.city, school.county, school.region, school.school_facts, school.general_info, school.school_facilities, image.image_id, image.path, image.name AS image_name FROM image_school JOIN school ON image_school.school_id = school.school_id RIGHT JOIN image ON image_school.image_id = image.image_id ORDER BY school_name LIMIT $offset, $rowsPerPage"; $result = mysql_query($query, $conn) or die('Error, query failed'); /***********************************/ //******Joes Pagination continued // how many rows we have in database $query = "SELECT COUNT(*) AS numrows FROM studentphotos"; $result = mysql_query($query) or die('Error, Count query failed'); $row = mysql_fetch_array($result, MYSQL_ASSOC); $numrows = $row['numrows']; // how many pages we have when using paging? $maxPage = ceil($numrows/$rowsPerPage); // print the link to access each page $self = $_SERVER['PHP_SELF']; $nav = ''; for($page = 1; $page <= $maxPage; $page++) { if ($page == $pageNum) { $nav .= " $page "; // no need to create a link to current page } else { $nav .= " <a href=\"$self?page=$page\">$page</a> "; } } // creating previous and next link // plus the link to go straight to // the first and last page if ($pageNum > 1) { $page = $pageNum - 1; $prev = " <a href=\"$self?page=$page\">« Prev</a> "; $first = " <a href=\"$self?page=1\">[First Page]</a> "; } else { $prev = ' '; // we're on page one, don't print previous link $first = ' '; // nor the first page link } if ($pageNum < $maxPage) { $page = $pageNum + 1; $next = " <a href=\"$self?page=$page\">Next »</a> "; $last = " <a href=\"$self?page=$maxPage\">[Last Page]</a> "; } else { $next = ' '; // we're on the last page, don't print next link $last = ' '; // nor the last page link } echo '<br/>'; echo '<br/>'; //If there is only one page then do nothing. if ($maxPage ==1) { } //Else show user page information and links to browse multiple pages. else { // print the navigation link echo '<p class ="pagination">'; echo $first . $prev . $nav . $next . $last; echo '</p>'; } Any help would be brilliant, thanks in advance
  15. Oh yeah it works, sorry if i didnt mention it, all i wanted to know was is the way i have done it ok, Is this how you would do it etc, thats all mate. cheers in advance
  16. I found this code on the tinternet, and modded it for my settings etc. $to = $email; $msg = 'Thank you your login details are ' . $email . ' and your password is ' . $password . ' To login please visit http://www.languageschoolsuk.com'; //Image in e-mail $mailimg = ' <img src="http://www.languageschoolsuk.com/images/logo.png"</a> ' ; $body =' <html> <head> <style> <!-- body, P.msoNormal, LI.msoNormal { background-position: top; background-color: #336699; margin-left: 10em; margin-top: 1em; font-family: "verdana"; font-size: 10pt; font-weight:bold ; color: "000000"; } --> </style> </head> </body> '; //To send HTML mail, the Content-type header must be set: $headers='MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html;charset=iso-8859-1' . "\r\n"; $headers .= 'From: info@languageschoolsuk.com' . "\r\n"; $bodys .= "$msg <br>"; $bodys .= "$mailimg"; $subject .="Login Details"; $body = $body . $bodys; if (mail($to, $subject, $body, $headers)) { //echo("<p>Message successfully sent!</p>"); } else { echo("<p>Message delivery failed...</p>"); } Just wondered what you guys think, meaning is it ok? Or is there anything im missing or should be doing. One thing i wondered is, what happens if there email company dont allow html email, will the code i have just display a normal txt email still.
  17. Does it matter which way you do it, how would you do it? Thanks by the way
  18. Thanks for the help got it working with your help. //check again db if user email allready exists $emailcheck =" SELECT * FROM student WHERE email ='$email'"; $result = mysql_query($emailcheck) or die("error on email check"); $row = mysql_num_rows($result); if( mysql_num_rows($result) == 0 ) { //Insert enquiry data $query = "INSERT INTO student(student_id, email, first_name, second_name, street, town, country, postcode, password) VALUES(0, '$email', '$firstname', '$surname', '$street', '$town', '$country', '$postcode', '$password')"; $result = mysql_query($query) or die("Error making contact"); } else { echo 'this email address already exists'; } Only question is why is this if( mysql_num_rows($result) == 0 ) and not if( mysql_num_rows($row) == 0 ) ? I dont understand do i not need this line then $row = mysql_num_rows($result);
  19. ive looked and changed it to mysql num rows, is it possible to use issett with it like this $row = mysql_num_rows($result); if(!isset($row['email'])) { //Insert enquiry data $query = "INSERT INTO student(student_id, email, first_name, second_name, street, town, country, postcode, password) VALUES(0, '$email', '$firstname', '$surname', '$street', '$town', '$country', '$postcode', '$password')"; $result = mysql_query($query) or die("Error making contact"); } I cant find out if it is, i have tried executing the code and it doesnt seem to work
  20. So im using the wrong sql function? thank you man
  21. Ok i was just missing the '' around email . For somereason its still inserting to db even if email exists, can anyone show me what im doing wrong. Here is the code for the check if email exists . //check again db if user email allready exists $emailcheck =" SELECT * FROM student WHERE email ='$email'"; $result = mysql_query($emailcheck) or die("error on email check"); $row = mysql_fetch_row($result); if(!isset($row['email'])) { //Insert enquiry data $query = "INSERT INTO student(student_id, email, first_name, second_name, street, town, country, postcode, password) VALUES(0, '$email', '$firstname', '$surname', '$street', '$town', '$country', '$postcode', '$password')"; $result = mysql_query($query) or die("Error making contact"); } else { echo 'this email address already exists'; } Can anyone see what im doing wrong
  22. I have this code //check again db if user email allready exists $emailcheck =" SELECT email FROM student WHERE email =$email"; $result = mysql_query($emailcheck) or die("error on email check"); $row = mysql_fetch_row($result); And im getting the die error, can anyone tell me why ? Thanks in advance
  23. Because my captcha is in my form its taking on the styling of the input boxes and there for pushing it off to the side which i obviously dont want. this can be seen here in firefox the box is off to one side in ie its fine. http://www.languageschoolsuk.com/register.php Can anyone help me
  24. I fixed it by using the var jq = jQuery.noConflict(); Woop woop, thanks alot guys, for now ill leave it like that, but im gonna do alot more reading up and then use one or the other eg mootoos or jquery
  25. Thanks guys, Im new to java script so pardon my ignorance, one question i wanted to ask is do <script type="text/javascript"> $(document).ready(function() { $(".signin").click(function(e) { e.preventDefault(); $("fieldset#signin_menu").toggle(); $(".signin").toggleClass("menu-open"); }); $("fieldset#signin_menu").mouseup(function() { return false }); $(document).mouseup(function(e) { if($(e.target).parent("a.signin").length==0) { $(".signin").removeClass("menu-open"); $("fieldset#signin_menu").hide(); } }); }); </script> have to be in the head of a document
×
×
  • 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.