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.

Blofeld

Members
  • Joined

  • Last visited

  1. So is there no way in a single SQL query to select the products once, and select all of the options to match? It just always feels a bit messy having loops within loops to me.
  2. I always seem to struggle to get my head around selecting from multiple tables whether or not to select from both, join or union etc... I have a table of products and a table of options for each product. The options table has the product id (prodictid) in each row. I am trying to output each product with a list of it's relevant options next to each one. This is what I have: $q = mysql_query(" SELECT *, SUBSTRING_INDEX(description, ' ', 30) AS description FROM products p, priceoptions o WHERE p.product_id = o.productid AND p.catid = '1' AND p.active = '1' "); while($row=mysql_fetch_array($q)){ output stuff here... } Problem is, if I use the while loop, I can get my array of options, but it will also output the product name, description as many times as there are options rather than just once per product. I suppose I could just set the variables in the while loop and omit all duplicates but it seems a bit crazy to extract the same details several times if it's only needed once. What is the best way to do this efficiently?
  3.    Blofeld reacted to a post in a topic: Nested list php while loop problem
  4. THat seems to have done the trick! Thanks!
  5. I have some rows in my DB and each has a ['subpage'] value of either 0 or 1 to indicate if it is a main page(0) or subpage(1) and they are ordered (column 'item order') so the parents are above their children e.g. 1 home (0) 2 about(0) 3 about-sub(1) 4 about-another-sub(1) 5 page(0) 6 page-sub1(1) 7 contact(0) What would be the best way to loop through these as a nested ul? I would have personally preferred to give each sub page a parent id but the person that created the CMS just did it like this so I am stuck with it!
  6. Both of those give exactly the same results again.
  7. That gets me: <tr><td></td></tr><input typ...etc... Confused!!!
  8. I have 3 input elements set as variables. When I do this: $("#cart > tbody:last").append($("<tr></tr>"), input, input2, input3); the output is (shortened inputs for quickness): <tr></tr><input typ... /><input typ... /><input typ... /> instead of: <tr><td><input typ... /><input typ... /><input typ... /></td></tr> Any ideas?
  9. Sussed it! Needed to set CURLOPT_REFERER
  10. I suppose I want it to run as though it were a cron file - would there be another way to do this? exec() perhaps?
  11. That is an option...but that would mean I would have to build some mailing list software too. This is just to automatically subscribe emails to the mailing list software within the hosting account. Not getting any errors with curl - it just doesn't seem to work with this particular sign-up. As if it needs to run in the browser and redirect before it will update or something
  12. I am trying to make a form automatically submit details to some mailing list software during a paypal IPN script. Basically, the form as standalone html, once filled in with an email address and submitted, will add that email to the mailing list. If I create a file and use header("Location: http://url/of/mailinglist/?email=$email"); then run the page it works...but of course brings me to the default success page. I just want this to happen on it's own during processing of other info in the paypal IPN verification script....so it processes payment, sends out emails, updates database and also runs that page. I can't use header() because it is ignored by the fact that the IPN takes the visitor back to the paypal payment complete page on the paypal site. I can't include it...that just wouldn't work. I have tried using curl to post the form details but that doesn't seem to work either. All I want is for that url to run somewhere on it's own, out of sight, but be triggered from my ipn script!!! Any ideas??!?
  13.    Demonolith reacted to a post in a topic: Facebook feed on my site
  14.    Demonolith reacted to a post in a topic: Facebook feed on my site
  15.    Demonolith reacted to a post in a topic: Facebook feed on my site
  16. if(isset($json_output['data'][$i]['picture'])){ echo '<br /><img src="'.$json_output['data'][$i]['picture'].'" alt="" />'; }
  17. You will have to output that URL in an img tag
  18. you are running the code in between script tags instead of php tags. get rid of these: <script></script> and do this instead... <?php //code here ?>
  19.    Demonolith reacted to a post in a topic: Facebook feed on my site
  20. Just lump the whole lot together and put it in your page where you want the feed to appear. Then style it to suit the rest of your page. Don't forget to add your own codes in and app id where stated (in uppercase) otherwise it won't work. When you are working on it, it may be best to change the cache time to 1 so that you can see your code changes in real time. Then when you are happy with it, set it to cache for as long as you like.

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.