php

PHPMailer - what sending method is most appropriate?

Hello. I need to use PHPMailer to send emails out for the following reasons: small lists (less then 500) password resets general notifications, 100ish emails at a time And PHPMailer gives me the option to send via mail(), sendmail, or SMTP. Is there any reason to prefer one of these methods over the other? I don't know enough about...

how to refresh list of photos after uploadify jquery

hello, I want to do a sort of photo editor, i use uploadify to upload images here are my files: http://www.mediafire.com/?3uzzgx5onzn the problem is: after upload the images i dinamicaly generate a thumb .. When I click on it it show me the large pictures in another page, i want to show the picture in a div or a paragraf! after I refre...

PHP and Javascript code needed to check if form fields are not empty

Javascript needed to prevent form submit if any of field is empty. all my form fields start names start with name=add[FieldName] those are the fields that need checking. PHP, backend check before submiting to database double check to make sure all $POST are not empty ...

Need PHP Email Script Solution

Designing forms has always been fun, but getting them to send email on the server side is another story. I have used various email scripts (dynaform,phpmailer, etc), and have experienced a ton of problems. So here is the site I am working on: Contact On the Right. It is very basic: no validation, no required fields. I simply need anythi...

how did facebook do "time ago"

Does anybody know how did facebook do that "time ago". I'm trying to do the same with php/javascript. I think it works something like php renders timestamp in html and then javascript continuously calculate the time ago, does anybody know anymore info about this? ...

What will the $result be when MySQL returns nothing?

This might seem ridiculously simple, but I've been getting all kinds of error depending on how I handle a query that returns nothing. $query = "SELECT * FROM messages WHERE id > ".$messageId; $result =mysql_query($query); $time = time(); while(time()-$time<60 && $result==false) { $result = mysql_query($query); } if(result != false)...

Javascript alert instead of redirect in PHP mail script

Thanks to Col. Shrapnel I am using a VERY basic PHP script to send emails. The form is located here. This is the script: <?php mail('[email protected]','Live Date Submission',implode("\n\n",$_POST)); header("Location: thankyou.html"); ?> When a user submits the form, they are redirected to a thankyou.html page. I want to edit the ...

Which is the best php opensource e-commerce for handle 5 million prducts import daily?

I am going to develop a B2B e-commerce site which contains 5 million products and all products will update from distributor daily.I am confusing which open source i have to use I tried magento but it importing very slowly.I am ready to spent money for highly configured server. ...

multiple 2 decimal place figure by a percentage

Hello A have price data stored like this: 10.25 And percentage data like this 1.1100 (1.00%) I need a function that accurately multiplies the price by the percentage. (in php) Thanks ...

PHP execution timing out after update

Needed Finfo but deleted msi package, so uninstalled php 5.3.0, downloaded 5.3.2 and installed. Now all my sites have max execution time error's when they hit my custom error handlers. No problems until I updated - has anyone ran into this before? Checked all error logs and ran through config files - nothing stands out. Edit: Commente...

What is the best way to have a dynamic dropdownlist in PHP and POST selected value

Hi, I am writing the following in PHP: i would like to have 2 dropdownlists, where the second one is populated from a mySQL dB according to the choice made on the first dropdown list. Then I would like to use the values of the selected values of the dropdownlist to call another PHP page in which I will generate a db query. Eg: List A: ...

php doctrine relational form naming for saving data

is it possible to have an html form organized/named in such a way that $foo->fromArray($_POST) would actually save relational data as well? example: html_form_fields: user_name country_name db_table_users: id user_name db_table_countries: id country_name update: forgot to say i'm trying to make this with zend framework forms ...

passing value of index number to different php file.

hi, i am a php beginner and have a question for you please. i have a text file with list of first and last names like this: john,smith sam,lewis david,davidson mike,anderson in my sort.php file, it sorts that name list by first name in ascending order with index number, which will display like this: 1. david,davidson 2. john,smith 3...

Function fgetcsv won't parse file without blank line at end of file

I'm working on a script to run through a CSV file (see previous post). I ran into a weird thing, where if my actual CSV file itself has a blank line at the end of it, it will open and parse just fine, but if it doesn't, if the end of the file ends at the end of the last line, it just shows up blank. ...

Check if exists, if so, update by 1++, if not insert

Hey guys quick question, I currently have an insert statement $query= "INSERT into new_mail VALUES ('$to1', '0')"; where fields are username, and message_number Currently what I would do to check if the entry exists, is do a select query then check the number of rows with mysql_num_rows (php). If rows==1 then I get the current message_nu...

Help a newbie with a PHP Function

I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using XMLRPC, can anyone give me the basics for using this function and maybe a brief over view? I want to learn how functions work and how to use them. EDIT: The below guideance works like a dream. I want...

how to use SMTP + PHP + MYSQL ?

I've got a mass mail function that sends e-mail to all email addresses in my mysql table, but they all get received marked as spam. I want to use smtp validate to fix this. How can I use smtp validation with mail($email, $subject, $message, $headers);? ...

Parsing WordPress XML, slash:comments syntax?

This is really just a syntax question. I have a PHP script that parses my WordPress feed and returns the latest posts. I also want my script to parse the # of comments, but the WordPress feed XML object for number of comments has a colon in it (slash:comments). It causes the following error: Parse error: syntax error, unexpected ...

how to return the current object?

in code igniter you can type: $query = $this->db->query("YOUR QUERY"); foreach ($query->result() as $row) { echo $row->title; echo $row->name; echo $row->body; } i guess that the query method returns the object it's part of. am i correct? if i am, how do you type the line where it returns the object? so what i wonder is ho...

wp_redirect acting weird. requires die() afterward?

I am writing a wordpress plugin that redirects the user. for some reason, wp_redirect does not work as think it should, namely: it seems not to redirect the user at all, unless I put a die command in directly after. here is some code: switch($_GET['wp_favorites_tax']) { case 'post_tag': wp_redirect(add_query_arg('tag', $_GET['...