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?
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.