Jump to content

GKWelding

Members
  • Posts

    268
  • Joined

  • Last visited

Everything posted by GKWelding

  1. $sql = mysql_query ("SELECT * FROM results WHERE resultteam='$team' order by ID DESC LIMIT ".$Start.",".$pageLimit."); I think, I have no way of testing it from here.
  2. what you need to research is something similar to a pagination script. See the following code and see if you can figure it out for yourself what the script is doing and how to incorporate this into your script. $max = 4; //max number of columns if($i==$max){ $i = 1; </TR><TR><TD>$product</TD>; }else{ <TD>$product</TD>; $i++; } As you can see from above it is not just as simple as creating a table with 4 columns and expecting PHP to know what to do.
  3. change: include_once("http://www.sharingizcaring.com/flashupload2/config.php"); to require_once "config.php"; and try it again. if it outputs an error then post it here and i'll take another look.
  4. same function causing the error? can you post the contents of index.php and maybe i can help?
  5. your include file path will have been set wrong in the php.ini file in that case.
  6. also, I take it the function checkLoggedIn() is located in another PHP file? Is this PHP file being included correctly in index.php? If not then it wont be able to find the function. To check this you need to change: include "functions.php"; to require "functions.php"; If the file isn't being included correctly the script will then tell you.
  7. Can you post the sections of code the rror is referring to plus a few lines either side?
  8. The ANSWER is in the error, the function is checkLoggedIn() and you're calling checkloggedin().... Function are CASE SENSITIVE.
  9. Eg. <INPUT TYPE="text" SIZE="12"></INPUT>
  10. Seems pretty comprehensive to me. Looks like it should do the job you want it to. Just make sure on any form fields you also set a max length too.
  11. <html> <head></head> <body> <?php if(isset($_POST['submit'])){ $firstname = mysql_real_escape_string($_POST['firstname']); $lastname = mysql_real_escape_string ($_POST['lastname']); $identitynumber = mysql_real_escape_string ($_POST['identitynumber']); if(isset($firstname)){ $where .= "firstname = "; $where .= $firstname; } if(isset($lastname)){ if(isset($firstname)){ $where .= " AND "; } $where .= "lastname = "; $where .= $lastname; } if(isset($identitynumber)){ if(isset($firstname) OR isset($lastname)){ $where .= " AND "; } $where .= "identitynumber = "; $where .= $identitynumber; } $sql = mysql_query("SELECT id, firstname, lastname, identitynumber FROM patientdemo WHERE $where"); if(mysql_num_rows($sql)>0){ WHILE($row = mysql_fetch_array($sql)){ $display .= "<tr><th>"; $display .= $row['firstname']; $display .= "</th><th>"; $display .= $row['lastname']; $display .= "</th><th>"; $display .= $row['identitynumber']; $display .= "</th></tr>"; } }else{ $display = "No Results Found!"; } } ?> <form method="POST" action="<?php echo $_SERVER['PHP_SELF']; ?>"> Search for patient:<br /> <p> First Name: <input type="text" id="firstname" name="firstname" /><br /> Last Name: <input type="text" id="lastname" name="lastname" /><br /> Identity Number: <input type="text" id="identitynumber" name="identitynumber" /><br /> <p> <input type="submit" value="Search!" /> </form> <table border cellspacing=0 cellpadding=5> <caption align=bottom> </caption> <tr> <td colspan=10 rowspan=10></td> <th colspan=10 align=center>Patient Report</th> </tr> <?php if(isset($display)){ echo $display; } ?> </table> </body> </html>
  12. you should probably also have a 'default' case just in case vyb3 is null...
  13. Agree with above. Have a form that will not allow entry to the site until the user populates it with their email address plus this 5 digit key you assign to them. Have the entries updated into a MySQL database that way you can do pretty much anything you want with them.
  14. To use functions such as pdf_new(); you whouls have the PDFlib installed in your PHP configuration. If you don't have it installed then go to the link below and install it... http://www.pdflib.com/products/pdflib-family/ Also, the function call should be PDF_new(); not pdf_new();...
  15. http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php#attachment
  16. yes it does, the srand() bit is only for versions of php older than 4.2 and that seeds the rand() function, however, in versions later than 4.2 you don't need to seed it and so just running rand() works fine.
  17. <?php srand(); //only needed if PHP version is less than 4.2 $sql=mysql_query("SELECT * FROM books WHERE Version=1 and Year=2008 ORDER BY Rand() LIMIT 1"); WHILE ($row=mysql_fetch_array($sql)){ DISPLAY CODE; } ?> This method will generate a truely random book every page load...
  18. my fault, try these instead... $head=preg_replace(#\"head\"#,$headl,$head); or $head=preg_replace(#"head"#,$headl,$head);
  19. $head=preg_replace(""head"",$headl,$head); Where $headl if the value you want to add to the existing sentence and $head is the existing sentence....
  20. Solution for people who are still interested, better late than never, this is how you do this easily and it works no matter how many type you have in your DB or whether you add more or remove some... SQL QUERY OF PRODUCTS DATABASE $typestore=$SQL['type']; //needs to be external from while command $display.="<html>"; $display.=SET THE INITIAL TYPE HEADING HTML; WHILE COMMAND { if($typestore==$type){ $typestore=$type; $display.="DYNAMIC HTML FOR PRODUCT"; }else{ $typestore=$type; $display.="HTML FOR NEW CATEGORY"; $display.="DYNAMIC HTML FOR PRODUCT"; } } $display.="</html>";
  21. http://validator.w3.org/feed/
  22. Ok, I think what you're looking to do is the following... You need to make the script that gets your drop down list a function. You can look that up in more details yourself but I'll provide a pseudo code example below... libfunc ($image, $library){ if ($library == "library1") { GENERATE DROP DOWN LIST FOR LIBRARY 1; echo $dropdownlist; }elseif ($library == "library2") { GENERATE DROP DOWN LIST FOR LIBRARY 2; echo $dropdownlist; }elseif ($library == "library3") { GENERATE DROP DOWN LIST FOR LIBRARY 3; echo $dropdownlist; } } In your main script you will then call the following from your main query. include "code above.php"; SQL QUERY OBTAINS VALUES OF $image AND $library; $dropdownlist=libfunc($image, $library); $htmlpage=CODE FOR HTML GENERATION PLUS $dropdownlist; echo $htmlpage; Tell me if I'm completely missing the point...
  23. In that case your view is an array and not an integer which is why you were getting the operand error in the first place. You probably need to clear out the session and try rerunning the script as you've probably still got the old session open.
×
×
  • 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.