The PHP method only works if PHP is installed as CGI. If it is an Apache module command line PHP won't work.
Your solution is ok, but anyone could trigger that script through the web - unless you have taken precautions in the script to allow execution only from e.g. the IP of the host or...
You will need to use multi-part mail. The best class to use for this is PHPMailer, available at http://phpmailer.sourceforge.net
You could try to write it yourself, but there is no need to reinvent the wheel.
There should be a part of the mail for HTML and a plain text alternative part. That...
The error lies in the fact that a single equal sign performs an assignment:
<?
if ($_SESSION['newcust']=FALSE){
?>
So, in fact, you are assigning the value FALSE to the session variable. You need two equal signs to perform a comparison:
<?
if ($_SESSION['newcust']==FALSE){
?>
The...
Here's another idea:
The suggested retrieval of the smallest image still includes data that is transferred in excess of the actual HTTP headers. You can limit the actual request to just the minimum HTTP headers. That way you can tell that the web server is responding and not stress it beyond...
I had written (a long time ago) a function for highlighting that could be used:
/**
* FUNCTION highlight
* Highlights search terms in an HTML or plain string
*
* @param $searchwords string The terms that will be split on spaces into individual words
* @param $subject string The haystack...
This can turn into a complicated topic - would you want to highlight the text even if it is a partial match, e.g. if "text" were inside a word like batextender?
Anyway, I would recommend to use a PCRE (Perl COmpatible Regular Expression) to handle this. Have a look at preg_replace...
Here's an alternative way:
1. Use the UNIX timestamp and add 60*60*24*2, i.e. 60 seconds * 60 minutes * 24 hours * 2 days
2. And then, this is what you missed, use the date() function to properly format the timestamp for human consumption.
You did essentially the right thing, 1152939600...
It must be a specific query that triggers the error and the query is issued via PHP code on a specific line.
My recommendation is to add specific indication where the error is triggered from, e.g. adding the line number by using
@mysql_query($sql) or die('Error: '.__FILE__.__LINE__.'...
Your hidden field is in the first form. The input elements are only known to the surrounding form tag.
Move the hidden tag into the second form and you'll be fine.
You haven't preserved the posted value in any fashion.
There are several ways to do that:
1. Use sessions. Store the posted value in a session variable and access it via the $_SESSION superglobal array or
2. Write out HTML, a hidden field which preserves the posted value:
echo "<input...
Here's a suggestion:
Name the select elements consistently, e.g.
<select name="sel_jobcode">
If you do that you can iterate the $_POST variables and decide by the key to add it to the SQL WHERE clause:
foreach ($_POST as $key=>$value){
#check if it's a select, and if not, continue (skip)...
Thanks for providing more info.
Do you use context switching (PHP blocks inline with HTML)?
All you need then is to call the function in the context where you want to insert the created <select> element:
...
Position: <?getdata("e107_act_emps", "position", "title", "title");?>
...
Jobcode...
Long texts and HTML like the one in question is a perfect place to use HEREDOC syntax (forget all the escaping):
http://www.php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc
It would be very helpful if you'd povirde the line number on which the error is reported and to point it out in the code.
It's just too much code and too little time...
How is the article id sent in the URL header?
Think about this:
1. Hopefully - and it is a default setting - register globals is off.
2. Look at the form's method (either get or post).
3. Inspect the superglobal array $_GET (for get requests) or $_POST (for post requests).
I assume your form submits the data to itself (look at the action...
FIrst of all, this is more a SQL question than a PHP question.
Anyway, here are some pointers:
1. You have to decide what you want to split on - it appears it is the comma.
2. Have a look at the explode() function in the PHP manual. It will put the search arguments into an array.
3. Iterate...
You are talking multi-part MIME mail here.
I recommend that you take a look at the PHPMailer class on sourceforge. It allows multi-part mime mail and is the best mail class out there:
http://phpmailer.sourceforge.net
Modular development is in my experienmce the best. I also would recommend to write object oriented code rather than function oriented code. The re-use of objects in other parts of the same application or of general objects across applications id of immense benefit.
Clean code for the functional...
A recommendation:
Instead of relying on the <meta> tag to refresh the page I would highly recommend to use the server side approach of PHP and user a header("Location: ...") directive.
When you use the meta tag you rely on the client side to do the work which in case of authentication is not...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.