Jump to content

the182guy

Members
  • Posts

    611
  • Joined

  • Last visited

Everything posted by the182guy

  1. As an alternative, sticking the files outside of the webroot (/www/, /htdocs/) would provide the same functionality without .htaccess This is the best option. If you have files that should only be available after purchase then you'll want them safely stored out of the web root. Robots.txt is no good because only "good" bots will obey it. Evil bots will simply ignore this.
  2. As mj said, you don't need to do any escaping when the email body is dynamically generated from somewhere.
  3. You shouldn't need shell_exec() to resize an image on the server side. Have a search, there are lots of examples using just the core PHP image functions.
  4. To use a background image just use <body style="background-image:url(/path/to/image.jpg);background-repeat:no-repeat;">
  5. You're using this to access data from the record set: $commentrow[3] That is very unreadable, when dealing with a set of fields as you are, use the field name like $commentrow['firstname']. Be sure to use mysql_fetch_assoc() not fetch_row() or fetch_array(). Also, it's a good idea to store small pieces of user information in the session such as first name so you can quickly access those details without having to query the db. Take for example a "Welcome John" sort of message shown on all pages.
  6. Also try keeping your code tidy with proper indentation, this will help you spot these sort of problems quicker.
  7. To change the value programatically you pass in the desired value to .val(myValue), that will then show the corresponding item in the dropdown.
  8. If in doubt about the post data, print it out or view it in firebug.
  9. Store the keys with the emails in a db then when the page is viewed check the key in the query strut against the db.
  10. I would split this up to handle checkout/purchase code into a checkout class and just keep cart relate stuff in the cart class.
  11. Do print_r($thepart) to see what array explode is returning
  12. Write A function in the db class rather than putting a whole while loop on one line of code. A good example of this is Joomla's loadAssocList and loadObjectList functions, which are generic methods for grabbing a whole recordset from any query without having to keep wring the while loop.
  13. Echo out the query and paste it here, or run it through phpMyAdmin.
  14. The only way you can find out if the user buys something from the retailer is if the retailer gives you a sales feed.
  15. Also usleep() if you want to delay execution accurate to less than a second. You might want to send the emails in batches as well with wait in between.
  16. It's the same for any array variable. Use print_r() to print out the array, this will allow you to visualise the structure of it and understand how it works. It's basically arrays within arrays aka a multidimensional array.
  17. In addition to Buddski's comments, it's a good idea to use a LIMIT on the query if you only want 1 row back. $query = mysql_query("SELECT * FROM users WHERE username='$user' AND password='$password' LIMIT 1");
  18. Check the SMTP settings in your php.ini config file.
  19. That message is showing because this evaluates to false: if ($numrows == 1) Which means your query here is either returning no rows, or more than one: $query = mysql_query("SELECT * FROM users WHERE username='$user' AND password='$password'");
  20. MySQL will take ORDER BY 'username' as a string literal, not a field name and that is why it's producing unexpected [to you] results. As AbraCadaver said use backticks or nothing at all for field names.
  21. 1. Instead of having all the properties public, make them private or protected and have methods to return them if needed, rather than public (no point using setters if they are public anyway). 2. You might want to re-think your logic where you check if a mail is sent, because currently it doesn't make sense, if a mail fails then the next succeeds, your script won't notice and will act like both succeeded. 3. Remove the continue statement because it does nothing when used like that. continue is for moving onto the next iteration, which your script will do anyway without that. 4. In the send method, you're overwriting the from name and headers, so if the coder had set it, it would be lost. 5. Why are you calling setFromName() twice in the send method? Not trying to rip it apart just giving some pointers.
  22. Either use a simple text link or image, in which case you would pass the event ID chosen in the link Inside the event loop: <a href="myscript.php?eventId=<?php echo $event['eventId']; ?>">Choose this Event</a> Or use multiple forms, one form for each button and have a hidden field in each button to send the event ID. Multiple submit buttons for the same form will only work if each button has a unique label and you can identify the event based on that - which is not a good way to do it. Inside the event loop: <form action="myscript.php" method="post"> <input type="hidden" name="eventId" value="<?php echo $event['eventId']; ?>" /> <input type="submit" value="Choose this Event" /> </form>
  23. Consider using jQuery to handle the AJAX as this will deal with all the browser discrepancies that are required for cross browser compatibility.
  24. You can't detect installed browser plugins because that information is not sent to the server because it would be a privacy violation.
×
×
  • 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.