Jump to content

Recommended Posts

I think...I know I need a little help here...

 

Background info: using MySQL (pretty comfortable with), PHP(new to this), Dreamweaver CS4 (have been using for about 6 months now for static websites)

 

What I am attempting to do is create an app that users can do a search by putting in their zip code and getting results within the radius (in miles) of several business in their area. Here is the part I am having most trouble with - the results should be displayed as images (which will be small in file size and stored in the database) and preferrably in a table with 10 results per page. They can then select (via a checkbox or something similar) which images they would like to add to their "cart". The images will not be purchased, but I want them to be able to print them as a watermarked pdf once they are done searching and selecting the images they want. When printed, I want to fit as many images on a page as possible (to save paper) - another table I suppose. Maybe even later add the ability to email or send images as a sms to their phone.

 

With that in mind, I really could use some suggestions on how to achieve this effectively. Do I need to set up a full blown shopping cart to achieve this, since no monetary transaction is taking place? Is their a simplier way to do this in DW that I am just not getting?

Also - how do I find a script for the zip code search and are there any suggestions for the db table layout of zip codes?

 

I have not written any code for this project yet, I am still in the "how the heck do I do this" phase. Thanks in advance to anyone who attempts to help me with this mess!  :)

Link to comment
https://forums.phpfreaks.com/topic/196937-do-i-need-a-shopping-cart-for-this/
Share on other sites

First, I wouldn't suggest storing the photos in the db.  Instead, store them in a folder(s), and have the db simply hold the paths to the photos instead.  It'll make your life far easier.

 

Second, who will be able to obtain these images?  Anyone?  Only registered users?  Will there be a limit on how many can be 'bought' at any one time?  The answers to these (and other) questions will inform your design.

 

I'm not sure about a zipcode lookup script/db set up.  I've never worked on a project that required something like that.  I'm sure a Google search would point you in the right direction.

 

I'm also not sure what you mean by 'Is their a simplier way to do this in DW that I am just not getting?'  PHP is simply code.  It can be written with any text editing program.  I actually use Notepad++ for my coding needs.  So, it's not a Dreamweaver issue, rather it's a lack of experience issue.  Don't feel bad, we've all been there.

 

Given your lack of experience with PHP, you should at least research what carts are available to you.  While it's not necessary to have one for this (in fact, something like this isn't all that difficult to do, if you know how), if you're looking for fast results, it may be your best bet.

Thanks for replying. My lack of experience with PHP is definitely an issue here! No doubt. :) My reference to Dreamweaver is that it allows you to build recordsets based on your database and you can insert them into an HTML table when the query is executed. DW helps the less experienced PHP people with this feature, pretty much writing the code for you - as long as you insert the proper query. I am just not sure how to incorporate selecting the items and having them sent to a "cart" type of thing, to just be printed in another form of an HTML table.  Since I don't know PHP very well, is that just a script that takes the selected items and sends them to an HTML table for display?

 

Users would have to login in order to select items and print, but not to just browse. There would be no limit as to how many they could select. The images themselves are not exactly images - really just a pdf with product information (text) and possible a company logo.

 

Sorry if I sound completely PHP ignorant...but I am! :)

For displaying the db data, yeah, you'd have to do it manually.  It's actually not that difficult.  There's generally two areas of complexity - writing the right query and getting the results to display correctly.

 

The first is dependent on your db structure.  I can't really say more than that without seeing it.

 

The second usually takes the form of a while-loop.  Each iteration prints one row of data from the results.  The issue here is related to markup - can you correctly print the results so they fit in with the rest of your layout?  It sounds simple, but a lot of beginners have problems with seeing the connection between looping through data manually and displaying it just right.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.