Jump to content

colleyboy

Members
  • Posts

    142
  • Joined

  • Last visited

    Never

Everything posted by colleyboy

  1. Try taking out the style and using a .css template instead.
  2. by taking out session.start on each page it seems to still give an error pointing towards another line? Am well confused.com!
  3. Yes... In the database make sure you save it as VarChar and write the link in from youtube for example. In the PHP then write something like: <A HREF="$databasecell">$databasecell</A> That way it uses the link in the db as a link AND displays the link too. Simplees
  4. have you tried sending email to these addresses outside of php ... like in a normal email program to see if they are set up properly. It sounds like a DNS error where it is not sure where to forward the emails to. I suggest you send a test email to see if you receive that first.
  5. Oh no... The login itself is still working... but I still get the same error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/updatescompanyinformation.php:3) in /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/companyinfoupdated.php on line 2 This is line 2: <? session_start(); <--------------- LINE 2 if(!isset($_SESSION['myusername'])){ header("location:login.html"); exit; // prevent access to all the rest of the code on the page } ?>
  6. This is the code for checklogin.php if that helps: <?php $host="localhost"; // Host name $username="xxxxxxxxxxx"; // Mysql username $password="xxxxxxxxxx"; // Mysql password $db_name="xxxxxxxxxxxxx"; // Database name $tbl_name="xxxxxxxxxxxxx"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // username and password sent from form $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; // To protect MySQL injection (more detail about MySQL injection) $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql="SELECT * FROM $tbl_name WHERE username='$myusername' and password='$mypassword'"; $result=mysql_query($sql); // Mysql_num_row is counting table row $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1){ // Register $myusername, $mypassword and redirect to file "index.php" session_register("myusername"); session_register("mypassword"); header("location:index.php"); } else { echo "Wrong Username or Password"; } ?>
  7. Thanks for that, I replaced the code in admin.php with : This is now at the start of all 'protected' pages: <? session_start(); if(!isset($_SESSION['username'])){ header("location:login.html"); exit; // prevent access to all the rest of the code on the page } ?> but now when I login it doesnt stay on the protected page instead it redirects back to the login.html any idea why? :S
  8. You only have else to point to index.php there is no command saying if the username and password are correct to actually point towards admin.php
  9. Hi there, I have a simple login script written but I get an error with it. It does work but shows an error on some pages. Let me explain. Three Files: Admin.php Login.html checklogin.php When the user has logged in they go to checklogin.php. If the username and password match 1 row in the database then it forwards the user to admin.php fine. Except I keep getting mysql warning messages: Warning: Cannot modify header information - headers already sent by (output started at /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/updatescompanyinformation.php:3) in /home/wormste1/public_html/tilburywebdesign/shop/templates/template1/admin/companyinfoupdated.php on line 3 At the start of each page I want password protected I put the following code: <? session_start(); if(!session_is_registered(myusername)){ header("location:login.html"); } ?> I can't work out why I am getting this error. Many Thanks, Ian
  10. Fantastic!!!! Many thanks, worked a charm, will work on an escape string now. Cheers =D!!! Ian
  11. ahh i noticed it still said... $what_price=$_GET['price']; $query="SELECT * FROM carpets WHERE price = '$what_type'"; it said what "type" i changed it to $what_price=$_GET['price']; $query="SELECT * FROM carpets WHERE price = '$what_price'"; now when i select the actual price... i.e: http://www.ircdirect.co.uk/FTPServers/supremecarpets/carpetprice.php?price=17.88 it shows the product that is that exact price. I wanted to query it for a price thats that... or less. I.E: http://www.ircdirect.co.uk/FTPServers/supremecarpets/carpetprice.php?price=<30.00 (Price... less than 30.00) then it shows all items 30.00 or below. Many Thanks, Ian
  12. it says: SELECT * FROM carpets WHERE price = '' it looks like valid sql as: $what_price=$_GET['price']; $query="SELECT * FROM carpets WHERE price = '$what_type'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ the $what_price gets the column "price" it then querys the database to return results. Weird... :S
  13. The whole page loads with "price" changed to other columns in the sql table like type and colour. it is VarChar preset in them too so there should be no reason to not load the price too. http://www.ircdirect.co.uk/FTPServers/supremecarpets/carpetprice.php?price=<30.00 thats the link to the price page (which shows no arrays at all) http://www.ircdirect.co.uk/FTPServers/supremecarpets/ thats the home page, click a colour or type to see what should happen. Tricky one ian
  14. Hi people, Having a small problem. I have managed to call arrays for the types and colours but now I want to call price. I tried "carpetprice.php?price=<30.00" but it arrays nothing. Wondering what I am doing wrong... hmm. I basically want to array prices below a certain price when typed into the url... I.E: carpetprice.php?price=<30.00 (Show all products with price below £30.00) carpetprice.php?price=<20.00 (Show all products with price below £20.00) Can't seem to work it out... help is needed i think . Many Thanks.. Heres the page coding below: <HTML> <HEAD> <?php include ('dbconnect.php'); ?> <TITLE>Supreme Carpets - High Quality Carpets at affordable prices - Grays High Street, Essex</TITLE> </HEAD> <BODY leftmargin="0" rightmargin="0" bottommargin="0" topmargin="3" LINK="BLACK" ALINK="BLACK" VLINK="BLACK"> <CENTER> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0"><TR><TD><CENTER><A HREF="index.php"><IMG SRC="images/tabs/carpet1.png" border="0"></A><A HREF="laminate.php"><IMG SRC="images/tabs/laminate1.png" border="0"></A><A HREF="vinyl.php"><IMG SRC="images/tabs/vinyl1.png" border="0"></A></A><A HREF="bookacall.php"><IMG SRC="images/tabs/bookacall1.png" border="0"></A><A HREF="contactus.php"><IMG SRC="images/tabs/contactus1.png" border="0"></A></CENTER></TD></TR></TABLE><TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" HEIGHT="100%" BGCOLOR="#be9051"><TR><TD valign="top"> </CENTER> <!-- MAIN --> <CENTER><FONT SIZE="2" FACE="VERDANA"><B>Looking for blinds? Click here!</B></CENTER> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> <TR> <TD><MARQUEE><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"></MARQUEE></TD> </TR> </TABLE> <!-- START OF LOWER PART OF WEBSITE --> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0"> <TR> <TD WIDTH="10" valign="top"> </TD> <TD WIDTH="252" HEIGHT="385" valign="top"> <!-- SEARCH BOX --> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> <TR> <TD WIDTH="23"><IMG SRC="images/main/search/topleft.png"></TD> <TD BACKGROUND="images/main/search/top.png"> </TD> <TD WIDTH="23"><IMG SRC="images/main/search/topright.png"></TD> </TR> <TR> <TD BACKGROUND="images/main/search/left.png" WIDTH="23"> </TD> <TD BACKGROUND="images/main/search/bg.png"> <!-- SEARCH BOX TEXT --> <FONT FACE="VERDANA" SIZE="2"> <CENTER><IMG SRC="images/main/search/searchheader.png"></CENTER> <B>By Colour</B><BR> <A HREF="carpetcolour.php?colour=cream"><IMG SRC="images/main/search/colours/creme.png" title="Cream, Ivory" border="0"></A> <A HREF="carpetcolour.php?colour=beige"><IMG SRC="images/main/search/colours/biege.png" title="Beige" border="0"></A> <A HREF="carpetcolour.php?colour=brown"><IMG SRC="images/main/search/colours/brown.png" title="Brown" border="0"></A><BR> <A HREF="carpetcolour.php?colour=lilac"><IMG SRC="images/main/search/colours/lilac.png" title="Lilac, Purple" border="0"></A> <A HREF="carpetcolour.php?colour=blue"><IMG SRC="images/main/search/colours/blue.png" title="Blue" border="0"></A> <A HREF="carpetcolour.php?colour=black"><IMG SRC="images/main/search/colours/black.png" title="Grey, Black, Silver" border="0"></A><BR> <A HREF="carpetcolour.php?colour=green"><IMG SRC="images/main/search/colours/green.png" title="Green" border="0"></A> <A HREF="carpetcolour.php?colour=yellow"><IMG SRC="images/main/search/colours/yellow.png" title="Yellow, Gold" border="0"></A> <A HREF="carpetcolour.php?colour=red"><IMG SRC="images/main/search/colours/red.png" title="Orange, Red, Terracotta, Burgundy, Peach, Pink" border="0"></A><BR> <FONT SIZE="1"><CENTER><U>See all</U></CENTER></FONT> <BR> <B>By Price per square metre</B><BR><BR> - £0.00 - £5.00 psm<BR> - £5.00 - £10.00 psm<BR> - £10.00 - £15.00 psm<BR> - £15.00 - £20.00 psm<BR> - £20.00 - £25.00 psm<BR> - £25.00 - £30.00 psm<BR> - £30.00 - £35.00 psm<BR> - £35.00 - £40.00 psm<BR> - £40.00 - £45.00 psm<BR> - £45.00 - £50.00 psm<BR> - £50.00+ psm<BR> <!-- END OF SEARCH BOX TEXT --> </TD> <TD BACKGROUND="images/main/search/right.png" WIDTH="23"> </TD> </TR> <TR> <TD WIDTH="23"><IMG SRC="images/main/search/bottomleft.png"></TD> <TD BACKGROUND="images/main/search/bottom.png"> </TD> <TD WIDTH="23"><IMG SRC="images/main/search/bottomright.png"></TD> </TR> </TABLE> <!-- END OF SEARCH BOX --> </TD> <TD WIDTH="10" valign="top"> </TD> <TD valign="top"> <!-- START OF RIGHT HAND MAIN SIDE --> <!-- CENTRAL RIGHT --> <?php // Make a MySQL Connection $what_price=$_GET['price']; $query="SELECT * FROM carpets WHERE price = '$what_type'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD valign=top width=30 />"; echo "<CENTER />"; echo "<A HREF=carpets.php?id=".$row['id']." />"; echo "<IMG SRC=".$row['imageloc']." width=100 height=100 border=0 />"; echo "</A />"; echo "</CENTER />"; echo "</TD />"; echo "<TD valign=top />"; echo "<CENTER />"; echo "<A HREF=carpets.php?id=".$row['id']." />"; echo $row['title']; echo "</A />"; echo "</CENTER />"; echo "<BR />"; echo "<CENTER />"; echo "<FONT SIZE=4 />"; echo "£"; echo $row['price']; echo " Per Square Metre"; echo "</FONT />"; echo "</CENTER />"; echo "</TD />"; echo "</TR />"; echo "</TABLE />"; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "<BR />"; } ?> <!-- END OF CENTRAL RIGHT --> <!-- END OF RIGHT HAND MAIN SIDE --> </TD> <TD WIDTH="10" valign="top"> </TD> </TR> </TABLE> <BR><BR><BR><BR> <CENTER><FONT SIZE="1" FACE="VERDANA">This Website was designed and is hosted by <A HREF="http://www.IRCDirect.co.uk">IRC Direct Website Services</A> - Copyright Supreme Carpets Ltd 2010 ©</FONT></CENTER> <!-- END OF LOWER PART OF WEBSITE --> <!-- END OF MAIN --> </TD></TR></TABLE> </BODY> </HTML>
  15. YES!!! done it... I didnt put the $b variable as a $_POST variable... silly me
  16. Sorry, but negative critisism isnt helpful. I can only do my best. I came on here for help... not for people to write scripts for me, but to help me correct any mistakes. I am only human. This is the script below: <HTML> <HEAD> <?php include ('dbconnect.php'); ?> <TITLE>Supreme Carpets - High Quality Carpets at affordable prices - Grays High Street, Essex</TITLE> </HEAD> <BODY leftmargin="0" rightmargin="0" bottommargin="0" topmargin="3" LINK="BLACK" ALINK="BLACK" VLINK="BLACK"> <CENTER> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0"><TR><TD><CENTER><A HREF="index.php"><IMG SRC="images/tabs/carpet1.png" border="0"></A><A HREF="laminate.php"><IMG SRC="images/tabs/laminate1.png" border="0"></A><A HREF="vinyl.php"><IMG SRC="images/tabs/vinyl1.png" border="0"></A></A><A HREF="bookacall.php"><IMG SRC="images/tabs/bookacall1.png" border="0"></A><A HREF="contactus.php"><IMG SRC="images/tabs/contactus1.png" border="0"></A></CENTER></TD></TR></TABLE><TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" HEIGHT="100%" BGCOLOR="#be9051"><TR><TD valign="top"> </CENTER> <!-- MAIN --> <CENTER><FONT SIZE="2" FACE="VERDANA"><B>Looking for blinds? Click here!</B></CENTER> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> <TR> <TD><MARQUEE><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"><IMG SRC="images/main/banner.png"></MARQUEE></TD> </TR> </TABLE> <!-- START OF LOWER PART OF WEBSITE --> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%" BORDER="0"> <TR> <TD WIDTH="10" valign="top"> </TD> <TD WIDTH="252" HEIGHT="385" valign="top"> <!-- SEARCH BOX --> <TABLE CELLPADDING="0" CELLSPACING="0" WIDTH="100%"> <TR> <TD WIDTH="23"><IMG SRC="images/main/search/topleft.png"></TD> <TD BACKGROUND="images/main/search/top.png"> </TD> <TD WIDTH="23"><IMG SRC="images/main/search/topright.png"></TD> </TR> <TR> <TD BACKGROUND="images/main/search/left.png" WIDTH="23"> </TD> <TD BACKGROUND="images/main/search/bg.png"> <!-- SEARCH BOX TEXT --> <FONT FACE="VERDANA" SIZE="2"> <CENTER><IMG SRC="images/main/search/searchheader.png"></CENTER> <B>By Colour</B><BR> <IMG SRC="images/main/search/colours/creme.png" title="Cream, Ivory"> <IMG SRC="images/main/search/colours/biege.png" title="Beige"> <IMG SRC="images/main/search/colours/brown.png" title="Brown"><BR> <IMG SRC="images/main/search/colours/lilac.png" title="Lilac, Purple"> <IMG SRC="images/main/search/colours/blue.png" title="Blue"> <IMG SRC="images/main/search/colours/black.png" title="Grey, Black, Silver"><BR> <IMG SRC="images/main/search/colours/green.png" title="Green"> <IMG SRC="images/main/search/colours/yellow.png" title="Yellow, Gold"> <IMG SRC="images/main/search/colours/red.png" title="Orange, Red, Terracotta, Burgundy, Peach, Pink"><BR> <FONT SIZE="1"><CENTER><U>See all</U></CENTER></FONT> <BR> <B>By Price per square metre</B><BR><BR> - £0.00 - £5.00 psm<BR> - £5.00 - £10.00 psm<BR> - £10.00 - £15.00 psm<BR> - £15.00 - £20.00 psm<BR> - £20.00 - £25.00 psm<BR> - £25.00 - £30.00 psm<BR> - £30.00 - £35.00 psm<BR> - £35.00 - £40.00 psm<BR> - £40.00 - £45.00 psm<BR> - £45.00 - £50.00 psm<BR> - £50.00+ psm<BR> <!-- END OF SEARCH BOX TEXT --> </TD> <TD BACKGROUND="images/main/search/right.png" WIDTH="23"> </TD> </TR> <TR> <TD WIDTH="23"><IMG SRC="images/main/search/bottomleft.png"></TD> <TD BACKGROUND="images/main/search/bottom.png"> </TD> <TD WIDTH="23"><IMG SRC="images/main/search/bottomright.png"></TD> </TR> </TABLE> <!-- END OF SEARCH BOX --> </TD> <TD WIDTH="10" valign="top"> </TD> <TD valign="top"> <!-- START OF RIGHT HAND MAIN SIDE --> <!-- CENTRAL RIGHT --> <?php // Make a MySQL Connection $what_id=$_GET['id']; $query="SELECT * FROM carpets WHERE id = '$what_id'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=200 VALIGN=top />"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<A HREF=".$row['imageloc']." target=_blank />"; echo "<IMG SRC=".$row['imageloc']." width=200 height=200 border=0 />"; echo "</A />"; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "</TD />"; echo "<TD width=5 />"; echo " "; echo "</TD />"; echo "<TD / VALIGN=top>"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<CENTER />"; echo "<U />"; echo $row['title']; echo "</U />"; echo "</CENTER />"; echo "<BR />"; echo "<CENTER />"; echo "<FONT SIZE=4 />"; echo "£"; echo $row['price']; echo " Per Square Metre"; echo "</FONT />"; echo "</CENTER />"; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "<BR />"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<CENTER />"; echo "<U />"; echo "Flooring Cost Calculator"; $a=$row['price']; $b=area; $total=$a*$b; echo "<FORM action=carpets.php?id=".$row['id']." method=post />"; echo "<input type=text name=area WIDTH=30 />"; echo "<input type=submit value=Calculate values />"; echo "</FORM />"; echo "</U />"; echo "$total"; echo "</CENTER />"; echo "<BR />"; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "</TD />"; echo "</TR />"; echo "</TABLE />"; echo "<BR />"; echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<CENTER />"; echo "<U />"; echo "Description"; echo "</U />"; echo "</CENTER />"; echo "<BR />"; echo "<CENTER />"; echo $row['description']; echo "</FONT />"; echo "</CENTER />"; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "<BR />"; echo "</TD />"; echo "</TR />"; echo "</TABLE />"; } ?> <!-- END OF CENTRAL RIGHT --> <!-- END OF RIGHT HAND MAIN SIDE --> </TD> <TD WIDTH="10" valign="top"> </TD> </TR> </TABLE> <BR><BR><BR><BR> <CENTER><FONT SIZE="1" FACE="VERDANA">This Website was designed and is hosted by <A HREF="http://www.IRCDirect.co.uk">IRC Direct Website Services</A> - Copyright Supreme Carpets Ltd 2010 ©</FONT></CENTER> <!-- END OF LOWER PART OF WEBSITE --> <!-- END OF MAIN --> </TD></TR></TABLE> </BODY> </HTML> Thats the whole page. I am stuck... and don't know whats wrong. Ian
  17. Well so far I have done the following: $a=$row['price']; $b=area; $total=$a*$b; echo "<FORM action=carpets.php?id=".$row['id']." method=post />"; echo "<input type=text name=area WIDTH=30 />"; echo "<input type=submit value=Calculate values />"; echo "</FORM />"; but for some reason when the page refreshes it doesn't come back with any value... still "0" always at the moment. Any help?
  18. Hi pplz... I am designing a carpet website for a friend but am having a problem. http://www.ircdirect.co.uk/FTPServers/supremecarpets/carpets.php?id=1 On this page ^^^ I want to make a simple script so that a person can enter a number, press calculate and it calculates the cost of the flooring. I.E: This flooring is: £17.88 per metre (its stored in the database under price). maybe something like: <?PHP echo "<FORM><input type=input></FORM>*.$row['imageloc']."; echo"<INPUT TYPE=SUBMIT></FORM"; ?> TBH I dont know, any help is very much appreciated as google couldnt help Many Thanks, Ian
  19. Hi people. I am creating a carpet website for a good friend of mine as a favour. I am storing the carpets info in a MYSQL database and am currently trying to relay the info on a page. I have the array kind of done but it is not producing the results I want. Let me explain further: The columns in my database under the table "carpets" are: id (auto incremented) colour type title price description imageloc ------ under the type I have various types of carpet (6-ish). They are: Twist, Striped etc etc... Heres the php problem. I have all the images there and ready on the page and want to link them all with linking commands. i.e: the main page is at: http://www.ircdirect.co.uk/FTPServers/supremecarpets/index.php the carpets results page is at: http://www.ircdirect.co.uk/FTPServers/supremecarpets/carpetlist.php on the index.php page I want to link them so that for example: If he looks for a striped carpet he clicks "striped" and is shows carpetlist.php but with the striped carpets displayed. example link: <A HREF="carpetlist.php?type=striped">IMAGE HERE</A> I have tried various coding on the carpetlist.php and cant seem to get it to work. here is the snippets: <?php // Make a MySQL Connection $query = "SELECT * FROM carpets GROUP BY type"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/topright.png /></TD />"; echo "</TR />"; echo "<TR />"; echo "<TD BACKGROUND=images/main/search/left.png />"; echo " "; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/bg.png />"; echo "<FONT FACE=VERDANA SIZE=1 />"; echo $row['title']; echo "</TD />"; echo "<TD BACKGROUND=images/main/search/right.png />"; echo " "; echo "</TD />"; echo "</TR />"; echo "<TR />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomleft.png /></TD />"; echo "<TD BACKGROUND=images/main/search/top.png /> </TD />"; echo "<TD WIDTH=23 /><IMG SRC=images/main/search/bottomright.png /></TD />"; echo "</TR />"; echo "</TABLE />"; echo "<BR />"; } ?> It displays ALL the results which is not what I want. I want only striped carpets, blue carpets etc.... Help is needed and VERY much appreciated! Kind Regards, Ian
  20. Hi. I have a list of prices in my database - I.E: NAME ------------ PRICE ----------------------------- APPLE ------------- 1.00 PEAR --------------- 1.00 BANANA ----------- 1.92 ----------------------------- in php i want to add the tables data together to show a total price for that columns data. I.E: Total cost: 3.92 How on earth do I do this? :S! Many Thanks
  21. I think theres an unassigned variable. $mm = $mrow['billnmbr']; echo "<option value=" . $mrow['billnmbr'] . ">"; what is $mm ? You cant assign a variable to an unassigned variable because it would be zero... hence it not showing anything.
  22. Ok mixing javascript with php.... im having bugs . I basically want to replace any broken image links with a picture "noimage.gif" in the images folder. I tried this code but am getting the error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/wormste1/public_html/tilburywebdesign/shop/FTPServers/barryottley/showroom.php on line 78 This is the javascript header - all seems fine: <script language="JavaScript" type="text/javascript"> function ImgError(source){ source.src = "/images/noimage.gif"; source.onerror = ""; return true; } </script> this is the code thats erroring... is it the way ive written in the code into the IMG tag? while($row = mysql_fetch_array($result)){ echo "<TABLE CELLPADDING=0 CELLSPACING=0 WIDTH=100% BORDER=0>"; echo "<TR />"; echo "<TD WIDTH=30% VALIGN=TOP />"; echo " <A HREF='images/".$row['photo']."' target=_blank><IMG SRC='images/".$row['photo']."' width=186 height=155 border=0 onerror="ImgError(this);" /></A> "; echo "<br />"; echo "</TD>"; echo "<TD WIDTH=10 VALIGN=TOP />";
  23. Hi guys and gals , got a minor problem. I have a table in which i want the "photo" column to have a default value of "noimage.jpg". I set the default value to "noimage.jpg" and put "as defined" too. but when i fill the form in and leave the upload field blank it doesnt show the noimage.jpg as it should and in the mysql table it leaves it blank and not with default value. Here is the inserts.php which adds the data to the mysql table. Can you help please. <CENTER><B>Vehicle Added</B></CENTER> <BR> <?php mysql_connect("localhost", "wormste1_barry", "barry") or die(mysql_error()); mysql_select_db("wormste1_barry") or die(mysql_error()); $CarName = mysql_real_escape_string(trim($_POST['CarName'])); $CarTitle = mysql_real_escape_string(trim($_POST['CarTitle'])); $CarPrice = mysql_real_escape_string(trim($_POST['CarPrice'])); $CarMiles = mysql_real_escape_string(trim($_POST['CarMiles'])); $CarDescription = mysql_real_escape_string(trim($_POST['CarDescription'])); $pic = mysql_real_escape_string(trim($_FILES['uploadedfile']['name'])); $target_path = "images/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; echo "<br />"; } else{ echo "There was an error uploading the file, please try again!"; } mysql_query("INSERT INTO cars (CarName, CarTitle, CarPrice, CarMiles, CarDescription, photo) VALUES('$CarName', '$CarTitle', '$CarPrice', '$CarMiles', '$CarDescription', '$pic' ) ") or die(mysql_error()); echo "The vehicle data has been added!"; ?>
×
×
  • 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.