Jump to content

kipper

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Everything posted by kipper

  1. I would be happy to hear from others on this. I see this is dated from 2008. Some of the code doesn't work and it requires one to pay for one of the services. So, if I have a database with a table of all the zip codes. I have store location with the zip codes. What is the best way to have a form, where an end user enters their zip code and it pulls up a 30 mile radius, of stores in that 30 mile radius.
  2. Hi there, this is a request for code snippet. I was looking to find the best way to create a zip code locator? As we have all seen as a store locator. For example, like http://www.bestbuy.com/site/olspage.jsp?id=cat12090&type=page. I don't need to search by the address, just the zip code. I have a number of stores, where I have the latitude and longitude. In my application, when I add a store, it inputs the lat and long in the database. Now, my challenge, is for a user to enters their zip code, it would show all the stores in a 50 mile radius. Or whatever radius I decide on. This is where I ask your feedback. I can buy a database with all the zip codes in the US. ( just USA), and do some sort of calculation based on the lat and long. OR Use an API. Perhaps Google. I would lean towards this one. I don't need the map to show up. I would start with a very basic list of the stores. Just like the Best Buy example, I only want to return the list of stores. Which way???? Thanks Kip
  3. Thank you everyone. So, the answer is no, there is not a way. As I mentioned, I know I put an image or a link, but that all requires a user to click on something. I was hoping to call a header. At least I know the answer is no. Thanks
  4. HI everyone, I am sure this has got to be common question. Is there a way to tell if an email recipient opened an email I sent? Here is the scenario. In an application where the application sends email campaigns. So, if I send out an email to 100 people, I want to keep track of how many of them actually opened the email. I do not want to rely on a reader clicking a link, or downloading image to determine if the "read" the email, as one can still read an email without doing those things. Is there a more reliable way? Thanks Kipper
  5. Yes, it is not the clarification that is an issue that is the problem, but when this same dude Pikachu2000, goes even over to my second post with a much more pin pointed question, self admits he doesn't know, but looks at this. Just don't answer if you don't know I guess is my motto. I found the answer in another forum with the exact same text. http://www.weberdev.com/get_example-4015.html or http://developers.evrsoft.com/forum/archive/index.php/t-1180.html It was exhausting.
  6. "Set up a POP3 mailbox, use PHP to read the email contents". This solves the issue with connecting to databases across servers.
  7. I wish I could get the global moderators. Each time I have posted a forum questions, it is frustrating as to some of the other forum members, that they want to answer some other question. Take the easy way out. I find it annoying. It would be nice that if the moderators can take a look and keep these people at bay. It may be picky, but the few times I have posted a question, if they don't know, then don't post. I have not gotten the answer and found it myself. Took a week, but I always figured it out. Next, I find that the other php forum are much more sophisticated and helpful. Not sure what you can do about this, but perhaps more involvement by the moderators. btw, I have about 5 other programming friends that all say the same thing. Thanks for listening.
  8. How does a web server, with a database connect to the emails it receives? How does the web server get the contents of the emails it receives so I can parse it? Thanks
  9. How does a web server, with a database, connect to the emails it receives? I appreciate your concern for how I might want to accomplish the task. But, for my reasons ( mostly security and access), the questions still remains the same. Does anyone know how these parsing programs work. I know how to have a form send the submitted values to an email, the email is sent to the designated server with the central database, the part I am stuck on, is when the emails arrives, how does the web server get the contents of the emails so they can parse. I can parse, I can insert into a database, I can mail, etc. It is this part where I was wondering how that is done. So, to keep it simple, How does a web server, with a database, connect to the emails it receives, so the code can insert the parsed email contents into the data base? How does a web server, with a database connect to the emails it receives? How does the web server get the contents of the emails it receives so I can parse it?
  10. It will go into one database. It is the route. It will cross servers. And, it is the way the application that has the central database is set up. There are many applications set up this way. It's a way to provide to the customer, the ones with the websites, you just provide them with an email address. It is simple for them, the customer.
  11. I think you are not understanding what I mean. I know how to send mail, I use mail or phpmailer. I know how to insert into databases. My hosts do allow sending emails. I send one to the person who completes the form. I am asking about an email parsing program. Not who once I have it to insert it into a database. I know to put a variable to (hidden field in the form) to show the origination. The question is not a basic one. I am an intermediate to advanced user. This is an accepted practice where I know there are other method. For our reason, we want to do an email parser. If you don't know, that is fine.
  12. No, I know how to to that. Here is the scenario. We have multiple websites that use a slightly different form, but they all collect firstname, lastname, email address and zip code. as in http://nobaltimorebeveragetax.com/. The goal, is to get the data from all these form, into one central database. Rather than each website putting the data in their own database on that server, it needs to go in one central database on a designated server. So, I have heard of email parsing. Rather than have a form, have the submit, and post to that database. The post values go into an email address. Called a paring email. So the values of $fname, $lanme, $email and $zip are sent to an email NOT into a database. Then, a little program receives these emails and parses the information from the content of the email and inserts to that central database. This practice makes it easy, because all you have to so on each form, rather than a POST and a Insert to a database, it sends an email with the vaules. I know this is done alot, because some applications provide a "Parsing email" to it's customers. Make sense?
  13. I am asking if anyone knows of any tutorials to take the contents of a simple form, hit submit, then the values go to an email, the email contents are then parsed and go into the correlating mysql table. For example, if I have a form like this http://nobaltimorebeveragetax.com/ It is only the first name, lastname, email address and zip code. I know how to do a POST or a GET, to put directly into a database table. The reason is because there are multiple sites with this type of form and would like them to go to one central database. I do not wish to do iframe since we would still have to style (css) each form. I have heard of "paring emails". Any tutorial, resources or suggestions would be most appreciated. Thanks Kip
  14. Thank you guys. But, I my problem is not the type of csv. Tab delimited is always preferred and the outcome is to generate the insert statements. As in my near last line of the code is: <code> echo " insert into wp_joinus (fname, lname) values ('{$cells[1]}' , '{$cells[2]}') "; </code> Since this has got to be a very common procedure, I would think there is some snippet to handle this. I use trim and a snippet I call msqlprep which takes care of magic quotes on or off depending on the version of php and so on. So, I was looking for some snippet that generates insert sql statements and does a really good job of cleaning or validating the values. (don't have to worry about the mysql connection and like that, just echo out the inserts. In response to dabaR, I always go php.net first. Which section do you mean? Your statement: " I don't see which snippet that generates the insert statements. Please define. Thanks for all your help guys. But, if you don't know, then it looks I have the really good snippet. I would be happy to share. Kip
  15. or at least just echo out the query ( insert statement). I wrote some code to take a very simple spreadsheet with name and address and import into a database table. Simple I thought, right? Well does anyone have some snippet of code that addresses apostrophes in names, extra commas and so on in the data? To keep it simple, I will just use first and last name. tab delimited. Does anyone have any code that is more sophsticated? Thanks Kip <code> $file = "philly.csv"; if($handle = fopen($file, 'r')) { while(!feof($handle)) { $line=fgets($handle); $cells = explode("\t", $line); echo " insert into wp_joinus (fname, lname) values ('{$cells[1]}' , '{$cells[2]}') "; } fclose($handle); } </code>
  16. That's a good idea but there are problems. The default user agent from curl tells paypal the request came from a script. I suppose I could pass the visitors user agent. But that's not all. Here is some code I adapted (stole) from the php.net site: $url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; $data = http_build_query($fields); $alternate_opts = array( 'http'=>array( 'method'=>"POST", 'header'=>"Content-type: application/x-www-form-urlencoded\r\n" . "Content-length: " . strlen($data), 'content'=>$data ) ); $alternate = stream_context_create($alternate_opts); readfile($url, false, $alternate); This got me to the login to the sand box page. Since I was already logged in I'm guessing paypal is not seeing the login cookie. Assuming the code I swiped is bulletproof and I didn't mess something up.
  17. It's fairly straightforward to submit to paypal with a GET. Something like: $data = http_build_query($fields); $final_url = $url . "?" . $data; header( 'Location: $final_url'); Takes you to paypal where you can put in credit card info and pay. BTW $url = https://www.sandbox.paypal.com/cgi-bin/webscr and $fields is an assoc array with customer contact and purchase information. cmd needs to be _cart. The problem is GET has a size limit that's not huge. It would be better to use POST. It has to be possible since forms do it all the time. Does anyone know how to do this programmatically? In other words, how do you set up the header info as a post and zip someone off to paypal? I have found a few things on the net but nothing actually works. Any help would be REAL help.
  18. In case you haven't already done so make shipping the last item. '&item_name_3'='Shipping' . '&amount_3'='9.95 . '&quantity_3'=>'1' It will show in the cart as shipping. I believe the paypal shipping doesn't work for carts.
  19. I am using the phpmailer by Worx. My SEND() mail works except that it is not html. phpmailer created the object for me, but for the life of me, I can't find where to or how to implement it. I am attaching an html file: $mail->MsgHTML(file_get_contents('newsletter.html')); but it defaults to sending in plain text AND, it lands in the SPAM folder. Any advice would be helpful. Below my code will be phpmailers support file (require once <CODE> $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host ="localhost"; $mail->Port =25; $mail->SMTPAuth = true; $mail->Username = "testuser@envisionintl.com"; $mail->Password ="error7575"; $mail->FromName = $from_name; $mail->From = $from; $mail->AddAddress($to, $to_name); $mail->AddCC($cc,$name='Brenda testing at the moment, cc is edwna'); $mail->Subject = $subject; $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML(file_get_contents('newsletter.html')); $mail->AddAttachment('seo.pdf'); // attachment $result = $mail->Send(); if($result) { $message = "Your email was successfully sent"; } else { $message = "There was an error in sending your email"; } } </CODE> I have attched the phpmailer support file, too big to copy paste [attachment deleted by admin]
  20. Dear gurus, I am an intermediate php developer. I am creating a web store. In general, I would like to know your thoughts on using the $_SESSION array for keeping track of items for a shopping cart. Would you advise using hidden html fields that will remember what they put in the cart, or do you think a cookie or better session cookie to keep track? Also, I was starting to install Zen Cart, where do you put the CURL files, in the root of local host, or in the root of the application, let's say, localhost/ or localhost/webstore? Thank you for your thoughts from experience. KP
  21. Thank you so much. THe answer is. HTML 3.0 does not allow nested forms. Nested forms is the answer. Despite the 400 errors are not real errors. This was a page a previous developer was fired and now we are trying to fix. This was a stumper because despite is being sloppy, it worked in all other browsers. If I new this small but important piece of information, surely it would have been found sooner. Thanks again for your trouble shooting methods. Kip
  22. Thank you. The code you site, would work, but my code .....($vid_id is an INT) // your example code <input type='text' name='order[1]' size='3' value='123' /> I am sure there is not issue with this above, however, using a variable is perhaps the problem. OR, it is not this line at all. I am only assuming it is this line since the array does not post. Or the print_r does not return the elements, only the first one. The file is too long to enter in this box. I have attached it. I am looking forward to your thoughts on this output. Thanks Kip // IE problem code <input type='text' name='order[$vid_id]' size='3' value='$ordering' /> I think it is how IE handles the name. ALSO, I changed the POST to a GET and the same thing happened. If you could help, it would be much appreciated. I have attached the View Source. BTW, this is what went through the validator and debugger as well as the original code. [attachment deleted by admin]
  23. Thank you all. But it does appear to be a bug in IE. error_reporting(E_ALL); is already enabled. It was validated in the HTML validator under W3C. I made the one correction that didn't make a difference. Apparently the browsers forgave that. But still removed the single quote. I debugged to find out exactly where the array does not return the elements only the first element is returned. I read the documentation before coming to this forum. I said the same thing "Wouldn't all browsers parse PHP the same way, if it is server-side, shouldn't that mean regardless of the browser the same output is shown?" But FACTS remain, working in ALL other browsers, but NOT IE 8 or 7 - not sure about 6. Unless someone has the correction or sees the problem, then you are just telling me what I already know or tried. The file is here in full and was attached. print_r the array and it works in all browsers, print_r the array in IE and you get the first element.
  24. Actually, this appears to be a bug in IE. Since it works in all other browsers. Seems naming a input text box with an array ( with the [ ] ) confuses IE. IE using ASP finds the [ ] has another meaning and this is a bug in IE's code. Clearly the error from the print_r($order) exit; tells me exactly WHERE the error is, but not WHAT the error is. Thanks for all your input, but looks like it is a bug. Kip
  25. Correct. I know I don't have to escape inner quotes. I am just trying all possiblities. It is still a problem. It only returns the first element in IE. I tried single and double quotes. It is just so weird. All looks fine...... I am not sure what else it could be. How IE handles associative arrays??? To give you an idea what the page looks like. It is the input text boxes. I use Web toolbar in FF to get more info. But IE returns no errors. Are their anyother debugging tools? thanks [attachment deleted by admin]
×
×
  • 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.