Jump to content

sjhwebdesign

Member
  • Posts

    46
  • Joined

  • Last visited

Everything posted by sjhwebdesign

  1. My friend has a ecommerce site, but its not database driven ie each product is an html page. The name of the product is in the page url eg ww w . site . co m/product_name . htm Is it possible to search for a url containing/matching a search term entered in a form? eg type in "red car" and get ww w . site. com/red_car_product. ht m preferably with php.
  2. I have a few map entries for my mobile disco business, in several different counties as it is a travelling business. I have had these for a long time and no issue. eg a PE10 (Lincs) postcode, CB1 (Cambs), LE1 (Leics), etc.. Suddenly all 5 entries come up with the same address (LE1). Even though when I go into my local business center control panel they all have the correct addresses that I have given them. I haven't made any changes, it just suddenly happened, any ideas? Will this correct itself next tim Google re-indexes, caches etc? I know technically you are only supposed to use one address, but I provide a service that travels and Google maps doesn't really acommodate for this, I rank quite well in the main Google results but now that Google gives upto 10 map results for any area / business related search people will click all the map results before the main results. I don't want to bother with Adwords, I have tried this and its a waste of time, firstly people read top left down to bottom, so they rarely click them unless they are one of the ones that Google puts above the map results occassionally. Even then most click thrus are other businesses checking the competition, people looking for email address or generally people who want to waste your time offering services you don't require.
  3. <?php $getcategories = mysql_query("SELECT FROM categories ORDER BY name ASC"); ?> <?php while($categories = mysql_fetch_array( $getcategories )) { ?> <?php echo $categories['name']; ?> <?php } ?>
  4. in terms of 1 big main image and the rest as thumbs, you would need to tag one image as the main image. this could be done by having the main image in the user table as a main image feild and the images table is the additional images. or you could have a extra feild in the images table to tag the image order eg "theorder", and make the query: $getimages = mysql_query("SELECT * FROM images WHERE ownerid = '$userid' ORDER BY theorder ASC");
  5. eg search by name: <?php $name = $_POST['name']; $getresults = mysql_query("SELECT * FROM users WHERE name = '$name'"); while ($results = mysql_fetch_array($getresults)) { echo $results['name']; echo $results['city']; echo $results['state']; $userid = $results['id']; $getimages = mysql_query("SELECT * FROM images WHERE ownerid = '$userid'"); while ($images = mysql_query($getimages)) { ?> <?php } } ?> you would have to create your html layout to suit your webpage.
  6. your user table will have: id (autonumber, primary key) name city state your images table will have: id (autonumber, primary key) imageurl (the location of image on server eg http://www.yoursite.com/images/image.jpg ownerid (this is the id from the users table) example user: 10 fred orlando florida corresponding images: 1 http://www.yoursite.com/images/image1.jpg 10 ---------------- 2 http://www.yoursite.com/images/image2.jpg 10 Both images are owner by 10 which is the id for fred in the user table. The image upload form will be: you would have already assigned $userid earlier in your script eg: $userid = $_COOKIE['userid']; // if your are using a login cookie for example.
  7. use html with php to display the image: <?php $getresults = mysql_query("SELECT * FROM yourtable WHERE id = '$userid'"); while ($result = mysql_fetch_array($getresults)) { ?> <?php } ?> for multiple images you would do this in 2 ways; a) if you have a set amount of images, you would have imageurl, imageurl2, imageurl3 etc... in your user table. unlimitted images, you need two tables, users, images. you then link the tables eg: images table would contain; id, imageurl, imageowner - with imageowner being the id of the user. the query would then be $getimages = mysql_query("SELECT * FROM images WHERE ownerid = '$userid'");
  8. i don't think you can actually save an image in mysql, you would save its url in a mysql databse feild eg images/pic.jpg you would then use html with php to display eg;
  9. you can export / import between mysql and access so you can use access offline and mysql online, however one may not be as upto date as the other etc.. you can't use mysql offline, so you would be limitted to access, which is better used with asp, not php. php and mysql go together but only online. asp and access go together and you can use access offline. HOWEVER: You could run the mysql database for both the customer with the website front end, and have a seperate admin website which is password protected for the company to use the data, however it would require an internet connection. On the other hand if the database is only to be accessed by the company, then you could have you own mysql server and access it locally (you would need to speak to your IT dept about this). either could be done with php/mysql or asp/access, so depends which way you want to do it.
  10. you don't need the access database, the mysql database is used instead(however you can import the access records into a mysql database if your export it as csv and use phpmyadmin to import it into your mysql database. To use a form with a mysql database you need to make a mysql connection: <?php // db settings $db_host = "mysql.yourhost.com"; $db_user = "username"; $db_pwd = "password"; $db_name = "database"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); ?> you then need to assign a variable to each form feild: You then need to handle the data: <?php if (isset($_POST['Submit'])) { $info = $_POST['info']; mysql_query("INSERT INTO `yourtable` (info) VALUES ('$info')"); } ?>
  11. looks like its coming from the host server itself. "sitecontent.aspx" Maybe this is a script by your hosting provider to monitor your site content?
  12. to remove from google add this to .htaccess; Redirect theredir/theirpage.htm http://www.yoursite.com/yourpage.htm'>http://www.yoursite.com/yourpage.htm (one for each page ) Redirect theredir/ http://www.yoursite.com/yourpage.htm (one for each dir) This will look for people entering the offending url and redirect them to your site. I'm not sure how to remove from google cache if they wont do it for you. You should delete your cookies etc from your pc, your could have a tracking cookie/virus which has got hold of your ftp settings.
  13. $query="SELECT ID, Name, Description, Location, ListPrice, Price, Image FROM proclist WHERE ID = '$pass'"; asks your database to return results where the ID feild is equal to "pass", you can't have an id of zero if this is the primary key for the database, so there will be no results in your table that have an ID of zero so nothing will be displayed, same way for example there where 5 entries in your database and you set "pass" as 6 it would return nothing.
  14. cheers this one is pretty good as it does images and youtube vids; h tt p://rando mous.c o m/tools/floatbox/
  15. thanks for the advice, ive got "thickbox" running on my site. for anone who wants to use this, the css file they have in the download link doesnt work properly, but if you view their source code and find the css link from there it works ok.
  16. try also paint.net (software name, not url) it's a clone of photoshop, but free.
  17. try: <? echo $stats['ip']; ?> instead, this will just show ip but not link to the site that locates it.
  18. I use the same script myself on my site and works ok, I use dreamweaver so not sure bout Webuilder. have you tried uploading it to server, it may be Webuilder don't like it, only thing that may upset it is ; <? echo $stats['ip']; ?> as it would normally be page.php?IP=theip, but thats how that site works.
  19. I want to know how to create this effect that is starting to get used alot in image galleries. Basically when the user clicks the image for "enlarge view", the image comes to front while the rest of the page fades to grey/black. eg http://w w w.din op c.c o m/shop/pc/Logitech-Wireless-keyboard-and-mouse-17p258.htm
  20. SITE STATS PAGE VIEWS TODAY: <? echo $dailyvisits; ?> TOTAL PAGE VIEWS: <? echo $totalvisits; ?> IP PAGE VIEWED DATE TIME REFERER BROWSER <?php while ($stats = mysql_fetch_array($getstats)) { ?> <? echo $stats['ip']; ?> <? echo $stats['page']; ?> <? echo $stats['date']; ?> <? echo $stats['time']; ?> <? echo $stats['referer']; ?> <? echo $stats['browser']; ?> <?php } ?>
  21. look up ip with h tt p://w ww.geo ipto ol.c om its a bit hit and miss though, because isp companies eg aol will route someone in northampton through an exchange in the lake district! other isp companies are more acurrate. the ip in this case is used so you can follow a visitors journey through your website.
  22. sorry my mistake, i meant id id (int 11 auto increment primary key), ip(vary 150), referer(vary 150) , browser(vary 150) , date(date), time(time), page(vary 150)
  23. just rename the pages from page.htm to page.php to insert a php code block use <?php to start it and ?> to close it, the html will work as it is as a .php page is php + html as for hit counter, create a table in your mysql database called stats, with; ip(int 11 auto increment primary key), referer(vary 150) , browser(vary 150) , date(date), time(time), page(vary 150) and add the following code to the top of each php page you wish to track <?php // db settings $db_host = "mysql.yourhost.com"; $db_user = "yourdatabaseuser"; $db_pwd = "yourdatabasepassword"; $db_name = "yourdatabasename"; mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); // record stats $ip = $_SERVER['REMOTE_ADDR']; // there ip $referer = $_SERVER['HTTP_REFERER']; // where they came from eg google $browser = $_SERVER['HTTP_USER_AGENT']; // browser - can also show search bots $date = date("Y/m/d"); // current date $time = date("H:i:s"); // current time $page = $_SERVER['PHP_SELF']; // page they visited mysql_query("INSERT INTO `stats` (ip, referer, browser, date, time, page) VALUES ('$ip', '$referer', '$browser', '$date', '$time', '$page')"); // end of stats ?>
  24. <?php $query="SELECT ID, Name, Location, Price FROM proclist"; $status=mysql_query($query) or die( "Query Failed."); ?> <?php while($nt=mysql_fetch_array($status)){ ?> <?php echo $nt['Name']; ?> <?php } ?>
  25. you are using the alt="" tag twice for each image, not sure if this would upset ff while ie forgives you.
×
×
  • Create New...