Jump to content

CroNiX

Staff Alumni
  • Posts

    1,469
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by CroNiX

  1. I don't know why you're doing it like you are, if I understand correctly. There is no need to put the POST value in a separate array and then loop over it, only to explode the value and assign it to another array. This assumes you have a form using arrays for the field name, IE: <input name="abc[]" type="checkbox" /> <input name="abc[]" type="checkbox" /> $updated = array(); if (isset($_POST['abc']) && is_array($_POST['abc'])) { foreach($_POST['abc'] as $field) { //grab id, name and date and assign to variables list($id, $name, $date) = explode(',', $field); //append $updated array with new array using wanted named key => field pairs $updated[] = array( 'id' => $id, 'name' => $name, 'date' => $date ); } } print_r($updated); //assuming $_POST['abc'][0] = '1,xyz,06/04/2015' //assuming $_POST['abc'][1] = '2,abc,06/05/2015' array( 0 => array( 'id' => '1', 'name' => 'xyz', 'date' => '06/04/2015' ), 1 => array( 'id' => '2', 'name' => 'abc', 'date' => '06/05/2015' ) ); If you're meaning your form is set up like this and NOT using arrays for input names: <input name="abc" type="checkbox" /> then it would be more like $updated = array(); if (isset($_POST['abc']) && ! empty($_POST['abc'])) { //grab id, name and date and assign to variables list($id, $name, $date) = explode(',', $_POST['abc']); //append $updated array with new array using wanted named key => field pairs $updated = array( 'id' => $id, 'name' => $name, 'date' => $date ); } print_r($updated); //assuming $_POST['abc'] = '1,xyz,06/04/2015' array( 'id' => '1', 'name' => 'xyz', 'date' => '06/04/2015' );
  2. I believe you want to include() the file, which loads AND parses the php file, not use file_get_contents() which loads any file as a string as ginerjm pointed out.
  3. I'm thinking its your query returning duplicate results. Have you checked what's actually being returned in the resultset?
  4. Using 301 redirect will also help inform search engines that your content has moved
  5. //display html message here You're being redirected to ...blah blah <?php sleep(10); //wait 10 seconds before redirecting header('Location: http://www.desmond-otoole.co.uk/', 301); ?> Using php with a delay would be more browser foolproof
  6. PHP has a default execution time of 300 seconds. Perhaps it's hitting that wall.
  7. What does your browsers console say? Is the request making it to the script?
  8. Basically the way most of them work is you output your image using html, and setting the height and width to be smaller, like a thumbnail. Then when you click the thumbnail, an image viewer pops up and shows the image at full size. Really nothing to do with PHP though.
  9. That's all done with javascript. There are a ton of plugins that do that sort of thing, including jQuery. Try googling "jquery photo viewer" or something similar.
  10. You would be better off using php to redirect rather than using js.
  11. You might check the file permissions on all of the PHPMailer files. Is sendmail installed on the server?
  12. Personally I wouldn't store the whole path and would just store the filename and create the path when outputting (or define it as a variable and use that when outputting). What if you decide to change where you store the images down the road? They're all hardcoded in your db.
  13. Just look up the mysqli functions on php.net. They show the proper use.
  14. Why not store the date that the person was last evaluated? Then when you query to get new person to evaluate, exclude those within a date range so you only get someone who hasn't been evaluated for that time period yet.
  15. You wouldn't store the abandoned cart data in session. You'd store it in another table using the users id, so when the user logs in you just check to see if they have an abandoned cart entry and see if they'd like to purchase it or delete it. When the cart is purchased, you wipe out that cart data from that table.
  16. white page with nothing usually indicates a fatal error, but you have error reporting turned off or display_errors turned off. Check your php error log or enable those settings so you SEE the error occurring.
  17. Because your while($rows) is ABOVE where you define $rows = $stmt->fetchAll(); , so $rows doesn't exist at the point where you're trying to use it in the while() loop.
  18. Also this won't work in an HTML email: <img src="track.php?id=123&image=logo.jpg" > You need the FULL url to the image, http://yoursite.com/track.php?id=123&image=logo.jpg
  19. You can't track text emails, and you will only be able to track the people using HTML email IF they have "display images" enabled in their email client, which is turned OFF in a lot of email clients by default. The way that tracking works is when the email client (basically a simple HTML browser) requests the image from YOUR server in order to display it, it creates an entry in the server log just like it does for ALL requests (html/js/css/etc) to the server. So at that point you KNOW the person opened the email or it wouldn't have made the image request. You obviously can't send an image in text email. So it's not perfect and won't be able to track everybody, only people who view the email as HTML AND have view images enabled.
  20. It seems pretty clear by the description in your first post what needs to be done. 1) Create a DB schema to store the required data from the web page - You'll need to identify what is needed 2) Retrieve the webpage using PHP 3) Parse the required data from the retrieved webpage and insert it into the db into the appropriate fields in your table(s) The only thing that isn't clear to me is what is meant by "metadata".
  21. But why do you need the extra step of an ajax call to do that when you could just build the options with the same data getSalas.php is doing to begin with? The only time I'd do it the way you are is if the options need to change from their original values at some point, like they select something in SELECT box A, which changes the results available in SELECT box B.
  22. I didn't read that he was using JS. He mentioned "php web script". But yes, that's too general of a question to answer without seeing the relevant code.
  23. He means why are you using javascript to built the options rather than having them directly populated by php when creating the form view.
  24. The website most likely is using some sort of facebook plugin, like to show likes and stuff. That code is spying on the users who are logged into facebook and who are also on your site, gathering information on everything they view or do on your site (at least pages that use their plugin). The same with google analytics...they track users viewing habits which is how they target "relevant" ads to each user. Same thing happens if you search in google and then go to a site that displays google adwords. You'll see ads on that site that is something you've searched for elsewhere. That's one reason why I always physically log out of facebook before going to a different site...then they can't track me. They can only track if you're logged into facebook and don't log out.
  25. What are these emails going to be for? Are they critical to your site? Will email go to end users or just internal staff? Email is a very complex beast if you want it to always get to the inbox of the recipient. There are IP reputations to consider, PTR records, RDNS records, SPF record, DKIM, whether your IP (or IP on same subnet) is in a RBL, and several other things that have to be perfect or a lot of ISPs will either reject the email, or put it in spam. If your email is critical, I'd seriously look into services like SendGrid, or even using a GMail (for business) account to send the email through. You don't even need to have an email server as you can use an external SMTP service to send the email through and use a good mailer like PHPMailer instead of the basic mail() function that php supplies. You can spend a lot of time trying to get email right, but unless you're an expert I'd leave it to the experts It's a very complex thing to get right and, no offense, but you seem to be struggling with the basics here.
×
×
  • 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.