GKWelding
Members-
Posts
268 -
Joined
-
Last visited
Everything posted by GKWelding
-
array_sum($pageerror);
-
$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.
-
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.
-
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.
-
Eg. <INPUT TYPE="text" SIZE="12"></INPUT>
-
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.
-
<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>
-
you should probably also have a 'default' case just in case vyb3 is null...
-
advice pls. best way to track users through logins?
GKWelding replied to kevgais's topic in PHP Coding Help
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. -
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();...
-
http://www.webcheatsheet.com/PHP/send_email_text_html_attachment.php#attachment
-
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.
-
<?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...
-
[SOLVED] removing quotes from text field input
GKWelding replied to kcp4911's topic in PHP Coding Help
my fault, try these instead... $head=preg_replace(#\"head\"#,$headl,$head); or $head=preg_replace(#"head"#,$headl,$head); -
[SOLVED] removing quotes from text field input
GKWelding replied to kcp4911's topic in PHP Coding Help
$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.... -
[SOLVED] Problem returning to an tag on a page in I.E
GKWelding replied to mark110384's topic in PHP Coding Help
what version of IE? -
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>";
-
http://validator.w3.org/feed/
-
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...
-
Weird error: "Unsupported operand types" when I run this script ...
GKWelding replied to MoMoMajor's topic in PHP Coding Help
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.