Jump to content

flowingwindrider

Members
  • Posts

    54
  • Joined

  • Last visited

    Never

Everything posted by flowingwindrider

  1. I have a series of tables in a database, each one pertaining to a classified ad category. I need another table that groups all of their id's together in one place. Do I set the foreign keys in the new table to reference the others, or do I set the fk's in each table to reference the new one?
  2. I'm having trouble learning to use foreign keys. Does anyone know of a good tutorial they could point me to?
  3. Worked like a charm, thanks!
  4. Any guesses as to why the border was just a single line across the top? I added the code exactly as you had it, and I've had this problem trying to add borders before.
  5. Hmmm, I see what you mean. First of all, that's a good trick to check things like this, thanks for the tip. Second, should that red border have gone completely around the box or just been a line on the top? As to the 'imbalance', I'll just have to try adjusting my tables.
  6. This didn't work, and I'm not sure what you mean by resetting the table, td, and tr elements
  7. Oh, I forgot to mention, this is happening in both FF and IE6
  8. There are in fact several divs contained inside the 'main' one, with different widths specified. It might be easier to see what I mean if you see the page. It is located at bransonentertainersguild.com/Members/classifieds.php Each column is a separate table, and I want to center the whole mess of it without loosing the form that it has now. The full code of the page is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Classifieds Categories</title> <style type="text/css"> #center{ margin: 0 auto; width: 90%; } a{ color: #0000ff; } .b1{ position: relative; top: 2px; left: 2px; float: left; width: 5%; font-size: 22pt; } .b2{ float: left; width: 43%; } .b3{ float: left; width: 43%; } .t1{ font-family: Poor Richard; font-size: 14pt; } .t2{ font-family: Verdana; font-size: 8pt; } .t3, .t4{ position: relative; font-family: Poor Richard; font-size: x-large; text-align: center; } .t3{ top: 8px; } .t4{ clear: both; } .t5{ font-size: 12pt; font-style: italic; } </style> </head> <body style="background-color: #0ACCF5; background-image: url('../images/InsetBackground.jpg')"> <?php $db = "bransone_classifieds"; include("connect.php"); $query_count = "SELECT COUNT(Ad_Id) AS Total FROM employment"; $result_count = mysql_query($query_count) or die ("Error in query" . mysql_error()); $fetch_result = mysql_fetch_assoc($result_count) or die ("Error in query" . mysql_error()); $totalrows = $fetch_result['Total']; $img = "\"../images/folder.gif\" width=\"17\" height=\"14\""; mysql_close($dbh); echo("<div class=\"t3\">Classified Ad Categories</div>"); echo("<br /><br />"); echo("<div id=\"center\"><div class=\"b1\"><table> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /></td></tr> </table></div> <div class=\"b2\"><table> <tr><td><span class=\"t1\"><a href=\"classifieds/automobiles/automobiles.htm\" title=\"Click to see Automobile Listings\">Automobiles</a><br></span> <span class=\"t2\">Cars, trucks, vans, sport utilities<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/employment/employment_listings.php\" title=\"Click to see Employment Oppertunities\">Employment</a></span><span class=\"t5\"> (".$totalrows.")</span><br> <span class=\"t2\">Non-Performance or Tech Opportunities<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/general/general_merchandise.htm\" title=\"Click to see General Merchandise Listings\">General Merchandise</a></span><br> <span class=\"t2\">Appliances, electronics, books, music, video games, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/pets/pets_and_supplies.htm\" title=\"Click to see Pet Listings\">Pets & Supplies</a></span><br> <span class=\"t2\">Pets, animals, supplies<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/rentals/rentals_and_roomates.htm\" title=\"Click to see Rental Listings\">Rentals & Roommates</a></span><br> <span class=\"t2\">Apartments, condo rentals, roommates, seasonal housing</span></td></tr> </table></div> <div class=\"b1\"><table> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /></td></tr> </table></div> <div class=\"b3\"><table> <tr><td><span class=\"t1\"><a href=\"classifieds/computers/computers_and_software.htm\" title=\"Click to see Technology Listings\">Computers & Software</a></span><br> <span class=\"t2\">Desktops, laptops, accessories, software<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/furniture/furniture.htm\" title=\"Click to see Furniture Listings\">Furniture</a></span><br> <span class=\"t2\">Sofas, tables, beds, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/music/music_and_musical_equipment.htm\" title=\"Click to see Music Listings\">Musical & Musical Equipment</a></span><br> <span class=\"t2\">Sheet music, instruments, sound equipment, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/real estate/real_estate.htm\" title=\"Click to see Real Estate Listings\">Real Estate</a></span><br> <span class=\"t2\">Homes, condos, properties<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/theatrical/theatrical_equipment.htm\" title=\"Click to see Theatrical Equipment Listings\">Theatrical Equipment</a></span><br> <span class=\"t2\">Lights, gels, costumes, props, etc.</span></td></tr> </table><br /><br /></div></div>"); echo("<div class=\"t4\">Have a Classified Ad to Submit? <a href=\"classifieds/submission.htm\">Click here</a>.</div>"); ?> </body> </html>
  9. I've spent quite some time now searching the web for info on how to center a div. I've tried several different ways, but my div is still off-center by roughly 1/2 inch to the left. I've named a div 'center' and put all my other divs inside of it. Here is the css code that I am trying: #center{ margin: 0 auto; width: 90%; } Any thoughts as to why it is so far off-center? I've also tried setting the css code as: #center{ margin-right: auto; margin-left: auto; width: 90%; }
  10. What do you want to have happen after the folder is open?
  11. Do you mean that you want someone to be able to input the code again at a later time and have the computer check to make sure that the code is valid? If so, it sounds like you need to store the code in a database for later comparison.
  12. I have a page that displays information grouped into tables and arranged with div tags. The problem is, for some reason most of the links on the page show up as links but aren't clickable. It's like they aren't there at all. That's the Firefox problem. In IE6 the links work fine, but the last echo command doesn't write to the browser at all. Would someone mind looking at the code and seeing if they know why this is happening? If you want to see the page in action it is located at bransonentertainersguild.com/Members/classifieds.php The code for the page is: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Classifieds Categories</title> <style type="text/css"> a{ color: #0000ff; } .b1{ position: relative; top: 2px; left: 2px; float: left; width: 5%; font-size: 22pt; } .b2{ float: left; width: 43%; } .t1{ font-family: Poor Richard; font-size: 14pt; } .t2{ font-family: Verdana; font-size: 8pt; } .t3, .t4{ position: relative; font-family: Poor Richard; font-size: x-large; text-align: center; } .t3{ top: 8px; } .t4{ top: 30px; } .t5{ font-size: 12pt; font-style: italic; } </style> </head> <body style="background-color: #0ACCF5; background-image: url('../images/InsetBackground.jpg')"> <?php $db = "bransone_classifieds"; include("connect.php"); $query_count = "SELECT COUNT(Ad_Id) AS Total FROM employment"; $result_count = mysql_query($query_count) or die ("Error in query" . mysql_error()); $fetch_result = mysql_fetch_assoc($result_count) or die ("Error in query" . mysql_error()); $totalrows = $fetch_result['Total']; $img = "\"../images/folder.gif\" width=\"17\" height=\"14\""; mysql_close($dbh); echo("<div class=\"t3\">Classified Ad Categories</div>"); echo("<br />"); echo("<div class=\"b1\"><table> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /></td></tr> </table></div> <div class=\"b2\"><table> <tr><td><span class=\"t1\"><a href=\"classifieds/automobiles/automobiles.htm\" title=\"Click to see Automobile Listings\">Automobiles</a><br></span> <span class=\"t2\">Cars, trucks, vans, sport utilities<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/employment/employment_listings.php\" title=\"Click to see Employment Oppertunities\">Employment</a></span><span class=\"t5\"> (".$totalrows.")</span><br> <span class=\"t2\">Non-Performance or Tech Opportunities<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/general/general_merchandise.htm\" title=\"Click to see General Merchandise Listings\">General Merchandise</a></span><br> <span class=\"t2\">Appliances, electronics, books, music, video games, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/pets/pets_and_supplies.htm\" title=\"Click to see Pet Listings\">Pets & Supplies</a></span><br> <span class=\"t2\">Pets, animals, supplies<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/rentals/rentals_and_roomates.htm\" title=\"Click to see Rental Listings\">Rentals & Roommates</a></span><br> <span class=\"t2\">Apartments, condo rentals, roommates, seasonal housing</span></td></tr> </table></div> <div class=\"b1\"><table> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /><br><br></td></tr> <tr><td><img src=".$img." /></td></tr> </table></div> <div class=\"b2\"><table> <tr><td><span class=\"t1\"><a href=\"classifieds/computers/computers_and_software.htm\" title=\"Click to see Technology Listings\">Computers & Software</a></span><br> <span class=\"t2\">Desktops, laptops, accessories, software<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/furniture/furniture.htm\" title=\"Click to see Furniture Listings\">Furniture</a></span><br> <span class=\"t2\">Sofas, tables, beds, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/music/music_and_musical_equipment.htm\" title=\"Click to see Music Listings\">Musical & Musical Equipment</a></span><br> <span class=\"t2\">Sheet music, instruments, sound equipment, etc.<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/real estate/real_estate.htm\" title=\"Click to see Real Estate Listings\">Real Estate</a></span><br> <span class=\"t2\">Homes, condos, properties<br><br></span></td></tr> <tr><td><span class=\"t1\"><a href=\"classifieds/theatrical/theatrical_equipment.htm\" title=\"Click to see Theatrical Equipment Listings\">Theatrical Equipment</a></span><br> <span class=\"t2\">Lights, gels, costumes, props, etc.</span></td></tr> </table></div>"); echo("<div class=\"t4\">Have a Classified Ad to Submit? <a href=\"classifieds/submission.htm\">Click here</a>.</div>"); ?> </body> </html>
  13. I'm trying to learn to replace the tables on my website with div tags. I've figured out some of the positioning to make it look like my old table, but I can't seem to get a border around the entire thing. Below is my code (this is just a test page for experimentation). Can anyone help me to understand why this border doesn't go around the whole thing? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Employment Listings</title> <style type="text/css"> #border { border: 3px solid #FFFFFF; } .s2, .s3, .s4, .s6{ font-family: "Poor Richard"; font-weight: normal; font-size: 16pt; text-align: center; background-color: #FFFFFF; position: relative; float: left; } .s2{ width: 10%; } .s3{ left: 6px; width: 20%; } .s4{ left: 9px; width: 15%; } .s5{ text-align: center; font-family: "Poor Richard"; font-size: 18pt; } .s6{ left: 3px; width: 53%; } </style> </head> <body style="background-color: #0ACCF5; background-image: url('../../../images/InsetBackground.jpg')"> <p class="s5">Employment Listings</p> <div id=border> <div><span class="s2">#</span></div> <div><span class="s6">Type of Job</span></div> <div><span class="s3">Posted On</span></div> <div><span class="s4">Details</span></div> </div> </body> </html>
  14. oh for heaven's sake! Can you see the idiot light shining over my head? Thanks for finding my error.
  15. This one's really got me. I have a 10 pages that all display results from their matching databases. Since they all need the same formatting and paginating I have chosen to insert this code using include(). Now, everything works just fine until you try to follow one of the pagination links. When you do, it sends you to an error page that I had created. The thing is, the error page you go to is in no way linked to the page that you started on! They aren't even in the same directory. The included file is name 'paginate.php' and it looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> .style1{ font-family: "Poor Richard"; font-weight: normal; font-size: 16pt; text-align: center; background-color: #FFFFFF; } .style2{ font-family: "Poor Richard"; font-size: 14pt; background-color: #57A8F9; text-align: left; } .style3{ font-family: "Poor Richard"; font-size: 14pt; background-color: #57A8F9; text-align: center; } .style4{ font-family: "Poor Richard"; font-size: 18pt; text-align: center; } .style5{ border: 2px solid #FFFFFF; padding: 2px; border-spacing: 3px; width: 100%; } .style6{ font-family: "Poor Richard"; font-size: 14pt; text-align: center; width: 100%; } </style> </head> <body> <?php echo ("<br>"); echo ("<table class=\"style6\">"); echo ("<tr>"); if($page != 1) { $pageprev = $page - 1; echo("<td style=\"width: 33%\"><a href=\"".$name."?page=$pageprev\">Previous ".$limit." Listings</a></td>"); } else { echo("<td style=\"width: 33%\">Previous ".$limit." Listings</td>"); } echo ("<td style=\"width: 33%\">"); $numofpages = $totalrows / $limit; for($i = 1; $i <= $numofpages; $i++) { if($i == $page) { echo($i." "); } else { echo("<a href=\"".$name."?page=$i\">$i</a> "); } } if(($totalrows % $limit) != 0) { if($i == $page) { echo($i." "); } else { echo("<a href=\"".$name."?page=$i\">$i</a> "); } } echo("</td>"); if(($totalrows - $limit * $page) > 0) { $pagenext = $page + 1; echo("<td style=\"width: 33%\"><a href=\"".$name."?page=$pagenext\">Next ".$limit." Listings</a></td>"); } else { echo("<td style=\"width: 33%\">Next ".$limit." Listings</td>"); } echo ("</tr></table"); mysql_close($dbh); ?> </body> </html> The file that includes paginate.php is called employ.php and it looks like this: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Employment Listings</title> </head> <body style="background-color: #0ACCF5; background-image: url('../../../images/InsetBackground.jpg')"> <?php $db = "bransone_classifieds"; $name = "employment.php"; include("connect.php"); $limit = 10; $query_count = "SELECT COUNT(Ad_Id) AS Total FROM employment"; $result_count = mysql_query($query_count) or die ("Error in query" . mysql_error()); $fetch_result = mysql_fetch_assoc($result_count) or die ("Error in query" . mysql_error()); $totalrows = $fetch_result['Total']; if(isset($_GET['page'])) { $page = $_GET['page']; } else { $page = 1; } $limitvalue = $page * $limit - $limit; $query = "SELECT Ad_Id, `Date`, Type_Job FROM employment ORDER BY `Date` DESC, Ad_Id DESC LIMIT $limitvalue, $limit"; $result = mysql_query($query) or die("Error: " . mysql_error()); echo "<p class=\"style4\">Employment Listings</p>"; if(mysql_num_rows($result) == 0) { echo ("<p class=\"style1\">There are currently no ads in this category.<\\p>"); } echo "<table class=\"style5\"> <tr class=\"style1\"> <td style=\"width: 10%\">#</td> <td>Type of Job</td> <td style=\"width: 20%\">Posted On</td> <td style=\"width: 15%\">Details</td> </tr>"; while($row = mysql_fetch_assoc($result)) { echo "<tr>"; echo "<td class=\"style3\">". $row['Ad_Id']."</td>"; echo "<td class=\"style2\">". $row['Type_Job']."</td>"; echo "<td class =\"style3\">". $row['Date']."</td>"; echo "<td class =\"style3\"><a href=\"details.php?id=". $row['Ad_Id']."\">Details</a></td>"; } echo "</table>"; include("paginate.php"); ?> <br /> <form> <div class="style6"> <input type="button" value="Back" onClick="history.go(-1);return true;"></div> </form> </body> </html> I can't see how I'm linking to a page that I haven't linked to, but that's what its doing. Since I have 10 pages that will all use the same code I'd really like to make this work. Any ideas? (sorry this is such a long post)
  16. I see...the php script in my include file was lodged in the body of standard html code. By deleting all the HTML and leaving strictly the php script the header error disappeared.
  17. I'm trying to use include() to connect to my database to insert variables gathered from an HTML form. I keep getting the dreaded header error whenever I try to process the form and send the result page using header() at the end. Am I not able to use both of these functions in one script?
  18. Is it possible to set an include_path to a location that is above the document_root? My document_root is home/username/public_html. I'd like to set the include_path to home/username/admin/include so that people cannot see source code that contains usernames and passwords to my databases. I believe my server is on a windows platform. Thanks!
  19. Alright, let me kinda start this over. I was wrong before, I'm running on a windows platform, not linux. I would like the include_path to lead to 'admin/includes'. My php.ini that I got from my hosting company looked like this at first: Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" include_path = ".:/usr/lib/php:/usr/local/lib/php" ; ; ; Windows: "\path1;\path2" include_path = ".:/usr/lib/php:/usr/local/lib/php" ; ; I have modified it to look like this: Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" include_path = ".:/usr/lib/php:/usr/local/lib/php" ; ; ; Windows: "\path1;\path2" include_path = ".;c:\usr\lib\php;\usr\local\lib\php;\admin\includes" ; 1)Should I completely get rid of the linux section? 2)Every example I can find online has the c: in it, but how do I know if that is truly the drive letter on my server? I have run phpinfo() and it seems to be listing the include_path the way the examples show it should work, and I have set the permissions to 777. Any ideas?
  20. I remain confused. I've entered the code just as you've listed it. I've set the file permissions. /admin/includes is in the root directory, not my public_html directory. It still doesn't function. The error being returned is: Warning: include() [function.include]: Failed opening 'var.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php:/admin/includes')
  21. The include-path section of the php.ini file that my web host gave me looks like this: Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" include_path = ".:/usr/lib/php:/usr/local/lib/php" ; ; ; Windows: "\path1;\path2" include_path = ".:/usr/lib/php:/usr/local/lib/php" ; ; It's a linux server, so why is there windows info included? Do I just delete out the windows parts?
  22. I having trouble configuring include_path in my php.ini file. I've created a directory named admin/includes and I thought that I had pointed the ini file to it, but it doesn't seem to work. That section of my php.ini file looks like: Paths and Directories ; ;;;;;;;;;;;;;;;;;;;;;;;;; ; UNIX: "/path1:/path2" include_path = ".:/admin/includes" ; ; ; Windows: "\path1;\path2" include_path = ".:\admin\includes" ; ; Thoughts?
  23. Ok, I think I get the basic idea and can play with this. Thanks as always for coming through for me!
  24. I have no idea even where to begin on this one: I have a classified ads page that lists just a few fields from each row of a database. I need the user to be able to click a link for each displayed row that will take them to a page with the full information from that row. If anyone can even tell me the name for this process then I can google it and find a tutorial, but I just don't have a clue. Further explanation: 1st page: a table that lists a unique id for each Ad, the type of job it lists, and the date it was posted. Next to this is the word 'details', which I would like to become the link to the 2nd page: For each unique id I want to display all the rest of the information for the listing such as wage, address, phone #, etc. Can anyone give me a starting poing?
  25. Never mind, I figured it out. Thanks anyway!
×
×
  • 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.