Results 1 to 2 of 2
  1. #1
    Join Date
    January 17th, 2005

    I am looking for a way to display merchant promotions dynamically within static html pages using php/mysql.

    My site has hundreds of categories of merchant listings on static pages. I would like to be able to add a short piece of php script to each listing that will search a mysql database of promotions and display whatever promotions apply to the listed merchant.

    I envision the mysql database to include tables for category, merchant, start date, end date, and code. This way the php script can search the database by category, merchant, and dates to display any matching code at each listing.

    I should just be able to copy and paste the code into the code table, type the merchant name, category, start date, and end date, into the appropriate tables, and not have to update promotions individually at each listing.

    For example, if has a promotion for free shipping on computers, I should be able to add this promotion to my database and the php script will display this promotion on my computer page where is listed.

    The php script would do a search that would display results by merchant (Overstock), category (Computers), start date, end date, and use display the code for that promotion as long as it falls within the start date and end date of the promotion.

    Does this make sense? Is it easily accomplished without some long piece of php code for each listing? Any ideas of where I could find code for such a purpose? I am using phpadmin for creating and maintaining mysql databases.

    Thanks for any suggestions you can give me.


  2. #2
    Full Member
    Join Date
    January 17th, 2005
    Too late for a reply? Anyway here we go...

    To include dynamic PHP content, it must be called from a PHP page.
    Since your site has static HTML pages, it cannot include a PHP script. It won't work because,
    Webserver will not compile/parse the HTML code. HTML content is handled by the Browser. Webserver will only parse/compile dynamic scripts like ASP,PHP,JSP etc.

    If you intend to use PHP with MySQL, go for a complete system development.
    Don't worry about Google PageRank.. you can always do some htaccess stuff to redirect the new page to the old one. That would still give best results.

    Meanwhile a quick fix would be using javascript
    < script src='whatever php script?search=something' >
    < / script >
    your script should return the html and it would be displayed on the static HTML page.
    .... And your javascript will not be recognized by SEs.

  3. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Which PHP Method will work best?
    By Dan76 in forum Programming / Datafeeds / Tools
    Replies: 10
    Last Post: March 18th, 2006, 11:35 AM
  2. Php Mysql - Repeating..??
    By AddHandler in forum Programming / Datafeeds / Tools
    Replies: 13
    Last Post: May 7th, 2005, 02:25 PM
  3. Grouping with PHP and MySQL
    By Doug247 in forum Programming / Datafeeds / Tools
    Replies: 3
    Last Post: March 24th, 2005, 09:07 AM
  4. PHP & mySQL but....
    By perfectG in forum Programming / Datafeeds / Tools
    Replies: 1
    Last Post: November 6th, 2002, 05:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts