Jump to content

jlhaslip

Advanced Member
  • Posts

    524
  • Joined

  • Last visited

Everything posted by jlhaslip

  1. Work through this example from a PHP book by Larry Ullman that prints out 5 cities and the zip codes. >br /> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Cities and Zip Codes <br />h2 {<br /> font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; <br /> font-size: 14pt; <br /> color : #960;<br /> text-align: center;<br />}<br />td {<br /> font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; <br /> font-size: 10pt; <br /> color : #333<br />}<br />.error {<br /> color: #F30;<br />}<br /> /* This page retrieves and displays all of the * cities and zip codes for a particular state. * The results will be shown in a table. */ // Abbreviation of state to show: $state = 'AK'; // Items to display per row: $items = 5; // Print a caption: echo "Cities and Zip Codes found in $state\n"; // Connect to the database: $dbc = @mysqli_connect ('localhost', 'username', 'password', 'zips') OR die (' Cannot connect to the database.'); // Get the cities and zip codes, ordered by city: $q = "SELECT city, zip_code FROM zip_codes WHERE state='$state' ORDER BY city"; $r = mysqli_query($dbc, $q); // Retrieve the results: if (mysqli_num_rows($r) > 0) { // Start a table: echo '</pre> <table border="2" width="90%" cellspacing="3" cellpadding="3" align="center"> '; // Need a counter: $i = 0; // Retrieve each record: while (list($city, $zip_code) = mysqli_fetch_array($r, MYSQLI_NUM)) { // Do we need to start a new row? if ($i == 0) { echo "\n"; } // Print the record: echo "\t$city, $zip_code\n"; // Increment the counter: $i++; // Do we need to end the row? if ($i == $items) { echo "\n"; $i = 0; // Reset counter. } } // End of while loop. if ($i > 0) { // Last row was incomplete. // Print the necessary number of cells: for (;$i echo " \n"; } // Complete the row. echo ''; } // End of ($i > 0) IF. // Close the table: echo '</table>';<br><br>} else { // Bad state abbreviation.<br><br> echo '<p class="error">An invalid state abbreviation was used.</p>';<br><br>} // End of main IF.<br><br>// Close the database connection:<br>mysqli_close($dbc);<br><br>?><br><br><p
  2. yes, this is very possible. Set a counter outside of a loop which prints the table cells. When the counter is at 5, reset the counter, end the current row and then start a new one.
  3. Don't the Search Engines use the Meta Description tag information?
  4. Server compression is a different issue. If you select for the Server to use compression, it will one of several methods to reduce the about of data which gets shipped down the Interwebs. The Browser receiving it will then de-compress the data for use in the Browser. It is automatic and transparent to the user.
  5. I can guarantee that those javascript questions are not directed towards me... And yes, it seems to have shifted a bit.
  6. Gather your information from the POST array $body=" Name $_POST['name'] City $_POST['city'] State $_POST['state'] Email $_POST['email']";
  7. this is what I use: http://jlhaslip.com/samples/email/
  8. I meant the Form php code. and the form handling script...
  9. page not found. There is an extra charc ater in the URL posted above. One soolution would be to have the cursor change "on-hover" to indicate the link is there. Check your CSS file to see if there is code affecting the cursor change.
  10. Have you checked the Tutorials at the killersites.com URL? Look at the very top of this Forum page for links to the videos.
  11. What I sometimes do is create a 'default' style sheet for the site structure - the main blocks on the page. Then another one to 'style' those blocks. Add images, colours, etc. to another CSS file. That lets me use and reuse the 'structure' andall of the 'style' information is adapted for the second site due to the separation of the CSS for the structure and the styling.
  12. Post the form for us to check. The form handling script will be able to see the chosen city and perform the re-direct. if you need a hand with that aspect of the design, let us know, but the basic version would be an if/else clause in the form handler.
  13. use phpmyadmin from your hosting account Cpanel.
  14. Yes, but it would require a server-side script. Do you have php support on your account?
  15. do you have a link for that script, please.
  16. jlhaslip

    about new website

    Can you post the Login code from your php script, please. We will need to see what you have to work with. Do you have a Member Profile page where they can edit their information? I would think that on a successful login, you can re-direct them there and have the script for adding stuff on that page, maybe.
  17. Are you able to send mail on your Hosting Account? Does the Host allow php mail? Some Web Hosting services dis-allow the php mail function. Some require SMTP. Check the value of $success and echo something if it is success or fail, depending on its value.
  18. And Heart related surgeries are the worst offenders, I am told. I pay $28.00 per month for Medical services. Prescriptions not included. It would include hospitalisation if required. A friend in the States pays $700 per month for a nearly identical plan. Ouch!
  19. Yup. I had to wait a whole day last time I booked a doctor's appointment. Other than that, I had a knee operation booked within 3 weeks. Not too shabby. I guess it depends on where you live and the 'local' resources. Overall, I like the Canadian system.
  20. Download a CMS like sNews, which includes an RSS function, and tear apart the good stuff.
  21. If there are php files, you would need a local Web Server, like Wamp or XAMPP set up on your local machine. Both of those also add a Mysql server. It allows you to work locally as if the files are uploaded, so you can write and check your code without the upload requirement. Saves the Server some work as well, in case the code fixes go into loops, etc.
  22. By using position: fixed on the header and left-hand sidebar, then php includes for the main page content. Works plenty fast enough for me (and the clients). Each page can be bookmarked since there are no complications from the Framed Doctype. Postion: fixed can even work with the legacy IE6 Browser if you follow some Tutorials as found at cssplay.co.uk. I'll post a Demo link when I find it. It was written several years ago, and I'll need to find it in my Archives.
  23. Without much ado, I'm thinking that your "framed Hybrid" looks and acts a lot like a fixed position 'Framed' site I already have the design for which allows me to bookmark specific pages. I'm not excited about this Demo. I'll wait for the Xframes Module to reach maturity.
×
×
  • Create New...