Jump to content

ryanfc

Members
  • Posts

    40
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ryanfc's Achievements

Member

Member (2/5)

0

Reputation

  1. I am looking to add a very simple shopping cart to a web site for a client. Previously I have used osCommerce and I like it but I do not think it is the correct fit for this client. They only have 30 items that go in the shopping cart, they do not want a log-in and they only accept cash, check or money order. Can anyone recommend a easy to install and easy to use shopping cart? The server I use runs php. Thanks for any input.
  2. ok i am creating a directory of local business and need a bit of help on something. I want to have it where a client can belong to more than 1 category or sub-category. The categories for example are Restaurants, Entertainment, etc. Then under Restaurants you have something like Greek, Italian, etc as the sub-categories. So I have 3 tables. The categories table with the cat title and id number. (there are only 7 categories) The sub categories table with the sub cat title, id number and the number of the category it belongs to. Then I have the client table that contains the client info such as business name, address, etc. In there I have a field for the category and sub category where I fill in the correct number. So if it is a restaurant (cat 1) and an Italian restaurant (sub cat 7) I fill in the correct fields with those numbers. Now with some clients I want to have them say under Restaurants and sub cat Italian and Caterers. When I try putting in 4,45 in the subcategories field of the client table it erases the ,45. So what can I do to fix this? (so that a client can belong to more than one sub-category. Thanks!
  3. I will try taking out the height and see what happens. The php created table is what seems to be messing it up, so it does have a little to do with PHP. Not trying to cause problems just asked if anyone had ever ran into this situation before.
  4. For the look of my site some pages have 2 columns and others 3 columns. I want these columns to always flow to the bottom of the page which I am trying to do with css instead of tables everywhere. But I seem to have a small problem. In each page there is a table populated by php/database. When the table is not to long the columns seem to work just fine. But once the table goes past the bottom cut off line of the screen the columns stop and do no reach the bottom of the page. Anyone know how to fix this problem?
  5. No I do not. I added those lines and have changed a few things so here is the new code for the page. <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style_home.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php require('///////'); ?> </head> <body> <?php ini_set('display_errors', 1); error_reporting(E_ALL); if (isset ($_POST['submit'])) { if ($dbc = mysql_connect ($dbhost, $dbuser, $dbpass)) { if (!mysql_select_db ($dbname)) { die ('could not select' . mysql_error() . ' '); } } else { die ('coud not connect' . mysql_error() . ' '); } $query = "INSERT INTO contactform (contact_id, name, email) VALUES (0, '{$_POST['name']}', '{$_POST['email']}')"; if (mysql_query ($query)) { print 'added'; } else { print "not added" . mysql_error() . "the query was $query"; } mysql_close(); } ?> <form method="POST" action=""> <p> <input name="name" type="text" /> </p> <p> <input name="email" type="text" /> </p> <p> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> </body> </html>
  6. well that is the thing...it does not give me any error and I check the database and nothing is there. here is the page: http://myevvspace.com/contact.php
  7. i have a database created and a table in that database called contactform. that table has 3 fields contact_id (the key), name and email. When a user goes to the contact.php page i want them to fill out the form and when it they hit submit I want it to send the name and e-mail to the contactform table. I eventually want the page to have more fields and have it write just the name and email address to the database and send all fields in an e-mail. But first I am just trying to get it to write to the database. Does that make sense?
  8. Ok I got this tutorial on writing to a database out of a book I have: PHP for the World Wide Web. However, it is not working. Can anyone help me with what I am doing wrong? Here is the code for the page. <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style_home.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php require('taken out for security'); ?> </head> <body> <?php if (isset ($_POST['submit'])) { if ($dbc = mysql_connect ($dbhost, $dbuser, $dbpass)) { if (!mysql_select_db ('contactform')) { die ('could not select' . mysql_error() . ' '); } } else { die ('coud not connect' . mysql_error() . ' '); } $query = "INSERT INTO contactform (contact_id, name, email) VALUES (0, '{$_POST['name']}', '{$_POST['email']}')"; if (mysql_query ($query)) { print 'added'; } else { print "not added" . mysql_error() . "the query was $query"; } mysql_close(); } ?> <form method="POST" action="contact.php"> <p> <input name="name" type="text" /> </p> <p> <input name="email" type="text" /> </p> <p> </p> <p> <input type="submit" name="Submit" value="Submit" /> </p> </form> </body> </html> Thanks.
  9. OK, I think I got it. I changed this: if ($keyword == "") { echo "<p>You forgot to enter a search term"; exit; } To this: if ($keyword == "") { echo "<p>You forgot to enter a search term"; } else { If anyone sees where that is going to cause some problem let me know. I have tested it but do not see any errors.
  10. Ok I found a tutorial on another site on how to create a basic search option on my site. I have added the code and changed it a bit to work the way I need it to, but have one problem. If a user enters nothing into the search field but hits search it prints the text 'You forgot to enter a search term'. The problem is it stops doing the rest of the code for the web site. So the right column and past that is missing. Here is the code... <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php //database connection $keyword = ($_POST['keyword']); $category_num = (int)$_GET['category']; $sub_category_num = (int)$_GET['sub_category']; $searching= ($_POST['searching']); $keyword = strip_tags($keyword); // Collects data from "friends" table $search = mysql_query("SELECT client.id, client.paid, client.sub_category, client.category, client.name, client.address, client.phone, sub_category.subcat_title, sub_category.id, category.cat_title, category.id FROM client, sub_category, category WHERE client.name LIKE '%$keyword%' AND client.sub_category = sub_category.id AND client.category = category.id order by name") or die(mysql_error()); // mysql_query("SELECT name, address, phone FROM client WHERE name LIKE '%$keyword%'") // or die(mysql_error()); $categorycrumb = mysql_query("SELECT cat_title FROM category WHERE id = '$category_num'") or die(mysql_error()); mysql_close ($conn); ?> </head> <body> <div id="header"><?php include("includes/header.php"); ?></div> <div id="navigation"><?php include("includes/navigation.php"); ?></div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="126" rowspan="2" align="left" valign="top" id="leftcontent"> <br /><?php //And we remind them what they searched for echo "<font class=searchedfor><b>You searched for:</b><br />" . $keyword . "</font>"; ?></td> <td rowspan="2" align="left" valign="top" id="centercontent"> <?php //This is only displayed if they have submitted the form if ($searching == "yes") { echo "<h2>Results</h2><p>"; //If they did not enter a search term we give them an error if ($keyword == "") { echo "<p>You forgot to enter a search term"; exit; } $anymatches=mysql_num_rows($search); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query<br><br>"; } else { echo '<table class=results cellpadding=3 cellspacing=0><tr height=18><td width=31% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Business Name</b></font></td><td width=29% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Address</b></font></td><td width=20% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Phone Number</b></font></td><td width=20% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Type</b></font></td></tr>'; while ($info = mysql_fetch_array( $search )) { // get the first letter of the name. let's convert // it to uppercase to make sure that 'A' and 'a' get // put into the same group. $letter = strtoupper(substr($info['name'],0,1)); // now we will check to see if the first letter of the // current name is the same as the first letter of the // previous name. If it is not, then we make a new // group 'header' with the letter. Since there is no // previous row on the first pass, we will automatically // have an underlined 'A' made (or whatever your list starts with) if ($letter != $prev_row) { echo '<tr><td height=18 colspan=4 bgcolor=#eeeeee><font class=result color=#585858><b>',$letter,'</b></font></td></tr>'; } // end if echo '<tr>'; // here we just echo out the name if ($info['paid'] == 1) echo "<td class=results><font class=result><a href=\"client_detail.php?category={$info['category']}&sub_category={$info['sub_category']}&client={$info[0]}\"><b>", $info['name'], '</b></a></font></td><td class=results><font class=result>', $info['address'], '</font></td><td class=results align=center><font class=result>', $info['phone'], "</font></td><td class=results align=center><font class=result_type>:: <a href=client_list.php?category={$info[10]}>", $info['cat_title'], "</a> ::<br /><a href=client_list.php?category={$info[10]}&sub_category={$info[8]}>", $info['subcat_title'], '</a></font></td>'; else echo '<td class=results><font class=result>', $info['name'], '</font></td><td class=results><font class=result>', $info['address'], '</font></td><td class=results align=center><font class=result>', $info['phone'], '</font></td><td class=results align=center><font class=result_type>:: ', $info['cat_title'], ' ::<br />', $info['subcat_title'], '</font></td>'; // and here we assign the current letter to $prev_row so // that on the next iteration of the loop, we will have // a previous row letter to compare $prev_row = $letter; } // end while echo '</tr></table>'; } } ?> <p> </p></td> <td height="34" align="center" valign="middle" id="searchbox"><form method="post" action="search.php" style="display:inline"><input type="text" id="keyword" name="keyword" value="search" class="search" /><input type="hidden" name="searching" value="yes" /></form></td> </tr> <tr> <td width="126" align="center" valign="top" id="rightcontent">right content for ads</td> </tr> </table> </body> </html> I know the problem is with this line: if ($keyword == "") { echo "<p>You forgot to enter a search term"; exit; } When it hits that exit it stops doing the code. What I do not know is how to fix it so that when a user does enter nothing into the database it does not pull all results from the database. The end database is going to be very big and this would cause a huge problem. Thanks for any help you can give me.
  11. My site is a local directory of businesses and when a user clicks on a category such as Dining it takes them to a page called client_list.php. This page lists all the business under that category. Then if the user wants to filter the results a bit they can choose a sub_category from the left side of the page such as Barbeque. Which will take the user to client_filter.php and only lists those places that are listed as Barbeque restaureants. So here is my problem when the user uses the filter it is only listing the places under that sub_category put is listing it several times and showing it under ever sub_category that is in the database. You can see what I mean if you go here: http://myevvspace.com/client_list.php?category=1 then choose Barbeque. Can anyone help me figure out why it is doing that? Here is the code for the page... <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php $category_num = (int)$_GET['category']; $sub_category_num = (int)$_GET['subcat']; // Collects data from "friends" table $data = mysql_query("SELECT client.id, client.paid, client.sub_category, client.category, client.name, client.address, client.phone, sub_category.title, sub_category.id FROM client, sub_category WHERE client.category = '$category_num' AND client.sub_category = '$sub_category_num' order by name") or die(mysql_error()); $filtertext = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $categorycrumb = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $subcategorycrumb = mysql_query("SELECT * FROM sub_category WHERE id = '$sub_category_num'") or die(mysql_error()); $sub_list = mysql_query("SELECT * FROM sub_category WHERE category = '$category_num' order by title") or die(mysql_error()); $location = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); mysql_close ($conn); ?> </head> <body> <div id="header"><?php include("includes/header.php"); ?></div> <div id="navigation"><?php include("includes/navigation.php"); ?></div> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="126" rowspan="2" align="left" valign="top" id="leftcontent"> <br /><form class="filter" method="get" action="client_filter.php"> <?php $cat1 = "Select a Cuisine:<br />"; $cat2 = "Select a Bar Type:<br />"; $cat3 = "Select your Entertainment:<br />"; $cat4 = "Select an Art:<br />"; $cat5 = "Select a Lodging:<br />"; $cat6 = "Select a Community:<br />"; $cat7 = "Select a Real Estate:<br />"; $cat8 = "Select a Service:<br />"; $current_category = $category_num; if ($current_category == 1) { echo $cat1; } elseif ($current_category == 2) { echo $cat2; } elseif ($current_category == 3) { echo $cat3; } elseif ($current_category == 4) { echo $cat4; } elseif ($current_category == 5) { echo $cat5; } elseif ($current_category == 6) { echo $cat6; } elseif ($current_category == 7) { echo $cat7; } elseif ($current_category == { echo $cat8; } echo "<select class=\"filter\" name=subcat>\n"; while($sub = mysql_fetch_array( $sub_list )) { echo "<option name=\"sub_category\" value=\"".$sub['id']."\">".$sub['title']."</option>\n"; } echo "</select><input type=\"hidden\" name=\"category\" value= \"$category_num\" /><div align=\"right\"><input class=\"filter\" type=\"submit\" name=\"Search\" value=\"Search\" /></div>"; ?> </form></div></td> <td rowspan="2" align="left" valign="top" id="centercontent"><div id="breadcrumb" align="right"> <?php Print "<a href=index.php class=breadcrumb>Home</a> :: "; while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "{$crumb1['title']}"; } ?></div> <p><img src="images/welcome.gif" alt="Welcome" width="106" height="21" /></p> <p>Listed below are all the companies we have for this category. Gold Advertisers have more info listed for them such as address, coupons, menues, etc. Just click on the button for more information. If you want to refine your search more just click on one of the categories to the left. This text needs a lot of work, it is just filler for now.</p> <p><?php echo '<table class=results cellpadding=3 cellspacing=0><tr height=18><td width=31% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Business Name</b></font></td><td width=29% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Address</b></font></td><td width=20% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Phone Number</b></font></td><td width=20% align=center bgcolor=#D5CB9A background=images/table_gradient.jpg><font class=result><b>Type</b></font></td></tr>'; while ($info = mysql_fetch_array( $data )) { // get the first letter of the name. let's convert // it to uppercase to make sure that 'A' and 'a' get // put into the same group. $letter = strtoupper(substr($info['name'],0,1)); // now we will check to see if the first letter of the // current name is the same as the first letter of the // previous name. If it is not, then we make a new // group 'header' with the letter. Since there is no // previous row on the first pass, we will automatically // have an underlined 'A' made (or whatever your list starts with) if ($letter != $prev_row) { echo '<tr><td height=18 colspan=4 bgcolor=#eeeeee><font class=result color=#585858><b>',$letter,'</b></font></td></tr>'; } // end if echo '<tr>'; // here we just echo out the name if ($info['paid'] == 1) echo "<td class=results><font class=result><a href=\"client_detail.php?category={$info['category']}&sub_category={$info['sub_category']}&client={$info[0]}\"><b>", $info['name'], '</b></a></font></td><td class=results><font class=result>', $info['address'], '</font></td><td class=results align=center><font class=result>', $info['phone'], '</font></td><td class=results align=center><font class=result_type>', $info['title'], '</font></td>'; else echo '<td class=results><font class=result>', $info['name'], '</font></td><td class=results><font class=result>', $info['address'], '</font></td><td class=results align=center><font class=result>', $info['phone'], '</font></td><td class=results align=center><font class=result_type>', $info['title'], '</font></td>'; // and here we assign the current letter to $prev_row so // that on the next iteration of the loop, we will have // a previous row letter to compare $prev_row = $letter; } // end while echo '</tr></table>'; ?> </p> <p> </p></td> <td height="34" align="center" valign="middle" id="searchbox"><form method="post" action="search.php" style="display:inline"><input type="text" id="keyword" name="keyword" value="search" class="search" /></form></td> </tr> <tr> <td width="126" align="center" valign="top" id="rightcontent">right content for ads</td> </tr> </table> </body> </html>
  12. Ok I have 3 tables in my database: The client table holds the client name, address, city, state, zip, sub_category and category (and a few other fields but that is not important). In the sub_category and category fields in the client table are just numbers which match the id numbers in the other 2 tables. the category table holds the id number and title the sub_category table holds the id number, title and category (which is just a number that matches the id number in the category table. Hopefully that all makes sense. Now what the problem I have run into is I have a table on my page that loads all businesses for a category. So if a user clicks on the Dining button on the home page a list of all restaurants will display in my table. Well I want the table to show the sub_category the business belongs to, however the field in the client table is just a number. How do I get it to show the text (title) of that sub_category? Here is the code for that page: <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php //comment out database connection $category_num = (int)$_GET['category']; // Collects data from "friends" table $data = mysql_query("SELECT * FROM client WHERE category = '$category_num' order by name") or die(mysql_error()); $sub_list = mysql_query("SELECT * FROM sub_category WHERE category = '$category_num' order by title") or die(mysql_error()); $categorycrumb = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $location = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); mysql_close ($conn); ?> </head> <body> <div id="header"><?php include("includes/header.php"); ?></div> <div id="navigation"><?php include("includes/navigation.php"); ?></div> <div id="banner"><?php include("includes/ads/banner.php"); ?></div> <div id="leftcontent"><p><form class="filter" method="GET" action="client_filter.php"> <?php $cat1 = "Select a Cuisine:<br />"; $cat2 = "Select a Bar Type:<br />"; $cat3 = "Select your Entertainment:<br />"; $cat4 = "Select an Art:<br />"; $cat5 = "Select a Lodging:<br />"; $cat6 = "Select a Community:<br />"; $cat7 = "Select a Real Estate:<br />"; $cat8 = "Select a Service:<br />"; $current_category = $category_num; if ($current_category == 1) { echo $cat1; } elseif ($current_category == 2) { echo $cat2; } elseif ($current_category == 3) { echo $cat3; } elseif ($current_category == 4) { echo $cat4; } elseif ($current_category == 5) { echo $cat5; } elseif ($current_category == 6) { echo $cat6; } elseif ($current_category == 7) { echo $cat7; } elseif ($current_category == { echo $cat8; } echo "<select class=\"filter\" name=subcat>\n"; while($sub = mysql_fetch_array( $sub_list )) { echo "<option name=\"sub_category\" value=\"".$sub['id']."\">".$sub['title']."</option>\n"; } echo "</select><input type=\"hidden\" name=\"category\" value= \"$category_num\" />\n<br /><div align=\"right\"><input class=\"filter\" type=\"submit\" name=\"Search\" value=\"Search\" /></div>"; ?></form></p></div> <div id="centercontent"> <div id="breadcrumb" align="right"><?php Print "<a href=index.php class=breadcrumb>Home</a> :: "; while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "{$crumb1['title']}"; } ?></div> <p><img src="images/welcome.gif" alt="Welcome" width="106" height="21" /></p> <p>Below you will find a list of all businesses under the <?php while ($userloc = mysql_fetch_array( $location)) { echo "{$userloc['title']}"; } ?> category. Those companies that are paid advertisers can be clicked on for more detailed information.</p> <p>If you want to refine your search for a certain type of business just click on the list to the left.</p> <p>If you would like to become a paid advertiser and list your hours, location, menus, coupons and more please give us a call at (812) 402.1490.</p> <p> </p> <p> <?php $prev_row =''; echo '<table class=results cellpadding=2 cellspacing=0><tr height=22><td width=25% align=center bgcolor=#D5CB9A><b>Business Name</b></td><td width=25% align=center bgcolor=#D5CB9A><b>Address</b></td><td width=25% align=center bgcolor=#D5CB9A><b>Phone Number</b></td><td width=25% align=center bgcolor=#D5CB9A><b>Type</b></td></tr>'; while($info = mysql_fetch_array( $data )) { $letter = strtoupper(substr($info['name'],0,1)); if ($letter != $prev_row) { if($count % 1) { for ($i = ($count % 1); $i < 1; $i++) echo '<td class=results width=25%> </td>'; echo '</tr>'; $count =0; } $prev_row = $letter; echo '<tr bgcolor=#E7E7E7><td colspan=\"4\"><font color=#993833><b>',$letter,'</b></font></td></tr>'; } if ($count % 1 == 0) echo '<tr>'; $count++; if ($info['paid'] == 1) echo "<td class=results width=25%><a href=\"client_detail.php?category={$info['category']}&sub_category={$info['sub_category']}&client={$info['id']}\">", $info['name'], '</a></td><td class=results width=25%>', $info['address'], '</td><td width=25% class=results>', $info['phone'], '</td><td width=25% class=results>', $info['id'], '</td>'; else echo '<td class=results width=25%>', $info['name'], '</a></td><td class=results width=25%>', $info['address'], '</td><td class=results width=25%>', $info['phone'], '</td><td class=results width=25%>', $info['id'], '</td>'; if ($count % 1 == 0) echo '</tr>'; } if($count % 1) { for ($i = ($count % 1); $i < 1; $i++) echo '<td class=results width=33%> </td>'; echo '</tr>'; } echo '</table>'; ?></p> </div> <div id="searchbox" align="center"><form method="POST" action="search.php"><img src="images/spacer.gif" width="10" height="8" /><br /><input type="text" id="keyword" name="keyword" value="search" class="search" /></form></div> <div id="rightcontent" align="center"><p>text</p></div> </body> </html> If you need any more information from me just let me know. Thanks. Here is the link to the page to see how it looks. http://myevvspace.com/client_list.php?category=1
  13. Finally figured it out (after messing with it and trying different combinations): <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php //database connection take out require_once 'phoogle.php'; $map = new PhoogleMap(); $map->setAPIKey("ABQIAAAA_xQ_dEBiJhTWuUYd_GnQCxRhPeVs-Y5MVG7J1BB2XI6iFoNTnBT7lQQVb07RhoCpKomWQg7UmVesPw"); $category_num = (int)$_GET['category']; $sub_category_num = (int)$_GET['sub_category']; // Collects data from "friends" table $data = mysql_query("SELECT * FROM client WHERE category = '$category_num' AND sub_category = '$sub_category_num' order by name") or die(mysql_error()); $filtertext = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $categorycrumb = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $subcategorycrumb = mysql_query("SELECT * FROM sub_category WHERE id = '$sub_category_num'") or die(mysql_error()); $sub_list = mysql_query("SELECT * FROM sub_category WHERE category = '$category_num' order by title") or die(mysql_error()); $location = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); mysql_close ($conn); ?> <? $map->printGoogleJS(); ?> </head> <body> <div id="header"><?php include("includes/header.php"); ?></div> <div id="navigation"><?php include("includes/navigation.php"); ?></div> <div id="banner"><?php include("includes/ads/banner.php"); ?></div> <div id="leftcontent"> <p><form class="filter" method="GET" action="client_filter.php"><?php $cat1 = "Select a Cuisine:<br />"; $cat2 = "Select a Bar Type:<br />"; $cat3 = "Select your Entertainment:<br />"; $cat4 = "Select an Art:<br />"; $cat5 = "Select a Lodging:<br />"; $cat6 = "Select a Community:<br />"; $cat7 = "Select a Real Estate:<br />"; $cat8 = "Select a Service:<br />"; $current_category = $category_num; if ($current_category == 1) { echo $cat1; } elseif ($current_category == 2) { echo $cat2; } elseif ($current_category == 3) { echo $cat3; } elseif ($current_category == 4) { echo $cat4; } elseif ($current_category == 5) { echo $cat5; } elseif ($current_category == 6) { echo $cat6; } elseif ($current_category == 7) { echo $cat7; } elseif ($current_category == { echo $cat8; } echo "<select class=\"filter\" name=subcat>\n"; while($sub = mysql_fetch_array( $sub_list )) { echo "<option name=\"sub_category\" value=\"".$sub['id']."\">".$sub['title']."</option>\n"; } echo "</select><input type=hidden name=category value= $category_num />\n<br /><div align=\"right\"><input class=\"filter\" type=\"submit\" name=\"Search\" value=\"Search\" /></div>"; ?></form></p></div> <div id="centercontent"> <div id="breadcrumb" align="right"><?php Print "<a href=index.php class=breadcrumb>Home</a> :: "; while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "<a href=client_list.php?category=$category_num class=breadcrumb>{$crumb1['title']}</a> :: "; } while ($crumb2 = mysql_fetch_array( $subcategorycrumb)) { echo "{$crumb2['title']}"; } // end while ?> </div><p><img src="images/welcome.gif" alt="Welcome" width="106" height="21" /></p> <p><?php while($info = mysql_fetch_array( $data )) { echo $info['name'], '<br />Address: ', $info['address'], '<br />Phone: ', $info['phone'], '<br /><img src=', $info['logo'], ' alt=United Bank /><br /><br />'; $map->addAddress("{$info['address']}, {$info['city']}, {$info['state']} {$info['zip']}"); $map->showMap(); } ?></p> <h3>The following points are displayed on the map:</h3> <h4>(displayed using a table with an id of "my_table")</h4> <? $map->showValidPoints("table","my_table"); ?> <h4>(dispayed using an unordered list with an id of "my_list")</h4> <? $map->showValidPoints("list","my_list"); ?> </div> <div id="searchbox" align="center"><form method="POST" action="search.php"><img src="images/spacer.gif" width="10" height="8" /><br /><input type="text" id="keyword" name="keyword" value="search" class="search" /></form></div> <div id="rightcontent" align="center"><p>text</p></div> </body> </html>
  14. Well google maps is what I am trying to use basically. Phoogle uses the google maps and the api but is suppose to help with using php with it. What I need to figure out is how to take the code I listed above and supply it with the address and other information it needs from a database and not hard code it. As every business is loaded into the client_detail.php. Does that make sense. Here is the link to Phoogle: http://www.systemsevendesigns.com/phoogle I have the code listed in my page but it has the addresses hard coded. How do I change it to pull the information it needs from the database. Here is the code of my page: <!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=iso-8859-1" /> <title>myevvspace.com | premium local listings</title> <link href="myevvspace_style.css" rel="stylesheet" type="text/css" /> <script src="navigation.js" type="text/javascript" language="javascript"></script> <?php //db connect lines taken out require_once 'phoogle.php'; $map = new PhoogleMap(); $map->setAPIKey("ABQIAAAA_xQ_dEBiJhTWuUYd_GnQCxRhPeVs-Y5MVG7J1BB2XI6iFoNTnBT7lQQVb07RhoCpKomWQg7UmVesPw"); $category_num = (int)$_GET['category']; $sub_category_num = (int)$_GET['sub_category']; // Collects data from "friends" table $data = mysql_query("SELECT * FROM client WHERE category = '$category_num' AND sub_category = '$sub_category_num' order by name") or die(mysql_error()); $filtertext = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $categorycrumb = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); $subcategorycrumb = mysql_query("SELECT * FROM sub_category WHERE id = '$sub_category_num'") or die(mysql_error()); $sub_list = mysql_query("SELECT * FROM sub_category WHERE category = '$category_num' order by title") or die(mysql_error()); $location = mysql_query("SELECT title FROM category WHERE id = '$category_num'") or die(mysql_error()); mysql_close ($conn); ?> <? $map->printGoogleJS(); ?> </head> <body> <div id="header"><?php include("includes/header.php"); ?></div> <div id="navigation"><?php include("includes/navigation.php"); ?></div> <div id="banner"><?php include("includes/ads/banner.php"); ?></div> <div id="leftcontent"> <p><form class="filter" method="GET" action="client_filter.php"><?php $cat1 = "Select a Cuisine:<br />"; $cat2 = "Select a Bar Type:<br />"; $cat3 = "Select your Entertainment:<br />"; $cat4 = "Select an Art:<br />"; $cat5 = "Select a Lodging:<br />"; $cat6 = "Select a Community:<br />"; $cat7 = "Select a Real Estate:<br />"; $cat8 = "Select a Service:<br />"; $current_category = $category_num; if ($current_category == 1) { echo $cat1; } elseif ($current_category == 2) { echo $cat2; } elseif ($current_category == 3) { echo $cat3; } elseif ($current_category == 4) { echo $cat4; } elseif ($current_category == 5) { echo $cat5; } elseif ($current_category == 6) { echo $cat6; } elseif ($current_category == 7) { echo $cat7; } elseif ($current_category == { echo $cat8; } echo "<select class=\"filter\" name=subcat>\n"; while($sub = mysql_fetch_array( $sub_list )) { echo "<option name=\"sub_category\" value=\"".$sub['id']."\">".$sub['title']."</option>\n"; } echo "</select><input type=hidden name=category value= $category_num />\n<br /><div align=\"right\"><input class=\"filter\" type=\"submit\" name=\"Search\" value=\"Search\" /></div>"; ?></form></p></div> <div id="centercontent"> <div id="breadcrumb" align="right"><?php Print "<a href=index.php class=breadcrumb>Home</a> :: "; while ($crumb1 = mysql_fetch_array( $categorycrumb)) { echo "<a href=client_list.php?category=$category_num class=breadcrumb>{$crumb1['title']}</a> :: "; } while ($crumb2 = mysql_fetch_array( $subcategorycrumb)) { echo "{$crumb2['title']}"; } // end while ?> </div><p><img src="images/welcome.gif" alt="Welcome" width="106" height="21" /></p> <p><?php while($info = mysql_fetch_array( $data )) { echo $info['name'], '<br />Address: ', $info['address'], '<br />Phone: ', $info['phone'], '<br /><img src=', $info['logo'], ' alt=United Bank /><br /><br />'; } $map->addAddress('208 Dingler Ave, Mooresville, NC 28115'); $map->addAddress('210 Doster Ave, Mooresville, NC 28115'); $map->addAddress('300 Dingler Ave, Mooresville, NC 28115'); $map->showMap(); ?> <h3>The following points are displayed on the map:</h3> <h4>(displayed using a table with an id of "my_table")</h4> <? $map->showValidPoints("table","my_table"); ?> <h4>(dispayed using an unordered list with an id of "my_list")</h4> <? $map->showValidPoints("list","my_list"); ?></p> </div> <div id="searchbox" align="center"><form method="POST" action="search.php"><img src="images/spacer.gif" width="10" height="8" /><br /><input type="text" id="keyword" name="keyword" value="search" class="search" /></form></div> <div id="rightcontent" align="center"><p>text</p></div> </body> </html>
×
×
  • 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.