Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

missindependent

Members
  • Joined

  • Last visited

  1.    Kaskhautual reacted to a post in a topic: Selecting multiple values from a database
  2. I changed my mind about echoing the results... i enhanced the calculations and formatted it as a total results page embedded in some html/css with a checksession and added a button to take the customer to a next page that would pull the totals from the database and would echo that.
  3. I am building a calculator that should be able to calculate the total cost of a floor by imputting the dimensions. I have worked out the calculation and done a form that saves the persons choices to the database.If the floor is 12X13 then the php to calculate is as follows: if ($_GET['calc'] == "yes") { $width = $_GET['width']; $length = $_GET['length']; $firstCal = ($length + 6); $secCal = ($width + 6) / 3; $flat = ($firstCal)*($secCal); //each represent type of flooring multiply by rate for material $flatC = $flat * 15; $flatT = $flat * 13; $flatW = $flat * 18; ceil($flat); print "<h3>FLAT</h3>"; print "TOTAL IN LINEAR FEET $flat<p>"; print "PRICE TT$: Clay $flatC.00, Wood $flatW.00, Tile $flatT.00"; My question how do i echo the results based on the choice made from the database onto a total sheet. (or what steps to try if the person choose a concrete floor with wood. Database: lenght=> width=> floor type=> covering I need help dont now what the next step in echoing the results
  4. I built the tables but in the choice table i used the names instead not the shoeid or sockid. I can rework this. The reason i used the names is for when the admin logs in they can view by the orderid or memberid and the exact details will show. I built the calculations separate using php on a page called total.php. My question is how do i calculate the total based on the choice from the table. e.g choice1 in ur table how do i select the shoe price e.g SELECT * FROM Choice where choiceid = $memberid; then i echo the result. Do i use an IF/ELSE statement ... but i am stuck here i dont know what to do. I failed my final yr project and i really need some help. Thanks for the response and help
  5. Ok let me see how to explain this: I have a database with shoes and sock with a cost. The user goes thru and a series of steps in a form and it saves to the database. I wrote calculations that calculates the cost of a shoe and the cost of a socks but i worked it out on a sheet called 'total.php'. $nike, $reebok and for socks $blue, $red So a person can choose a nike shoe and blue sock, or a nike shoe and red sock. Or the person can choose a reebok shoe and a blue sock or a reebok shoe and red sock. So i use a select statement to recall what was chosen : SELECT * FROM Choice where memberid = $userid; and this works. What do i do next: Do i use an if, else statement?? My predicament is how do i go about selecting the cost of a shoe and sock and echoing the results on a separate sheet?
  6. The following is the php script i used and to select the image from the db and i display the image in the web page with html using the initial line i gave which worked. <?php // this is the script to retrieve image from database, file name "showimage2.php include ("databaseconnect.php"); if(isset($_GET['id'])) { $id = mysql_real_escape_string($_GET['id']); $query = "SELECT image FROM color WHERE id='$id'"; $result = mysql_query($query,$con); $row = mysql_fetch_array($result); $imageData = $row["image"]; header("content-type :image/jpeg"); echo ($imageData); } else { echo "Error!"; } ?> <html> <td><img src="showimage2.php?id=5" title="tan" width="150"height="150"/></td> </html> I have started doing some reading on the initial advice you gave me for storing the images in folders..thanks
  7. Yes i did upload the pictures to the database via an upload script, and used a query to select the image and display it onto the webpage. The html above is what i used - (as the tutor said I hard coded the images into the webpage which was wrong). I then used radio buttons so a selection can be made on the image with a label I guess what they wanted is "i could just upload an image and it would automatically be added to the page and be displayed without i guess coding it into the html.. is that even possible??
  8. Thanks guys i need some time to try both examples above. I especially want to try the one with the thumbnails with the small and larger images. Will let u know if it worked out.
  9. Ok...a little background on my situation Just failed my bsc final project. I uploaded some images to the database using a php script and it worked and the images were displayed in the web page perfectly... unfortunately the lecturers said i hard code the image into the html in a form to get it displayed an that was wrong for adding additional pictures. the following script i used in the html below and it worked. <td><img src="showimage2.php?id=5" title="tan" width="150"height="150"/></td> Is there another way to use php to add images to a web page for it to be displayed automatically somehow? Can someone provide a link or advice thanks
  10. Thanks so much for the welcome guys... nice php jokes...lol
  11. Hi I am php challenged. I failed the final project because of a whole bunch of php errors so i joined this forum to interact with persons to help me get over my challenges

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.