-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
What user and what posted message? Your question is overly vague.
-
If the number of rows in the table is not going to change during a typical visit to your site, you should save the $count as a session variable to avoid repeating the first query on each page request. Does your second query have proper indexes setup so that it executes as efficiently as possible?
-
Your sending mail server has relaying restricting in effect (which it should) and thinks that you are relaying an email through it. This would occur if neither of the To: or From: address is hosted at the sending mail server. Is the From: address hosted at the sending mail server? You can also get a "Unable to relay" error if your mail server unconditionally requires SMTP authentication in order to send any email, relayed or not.
-
[SOLVED] Convert Dynamic PHP page to Static HTML
PFMaBiSmAd replied to isedeasy's topic in PHP Coding Help
Use ob_end_clean(); (which clears the output buffer) instead of ob_end_flush(); (which flushes the output buffer to the browser.) -
A) There is absolutely no reason to be using eval() for what you are doing (all you are doing is using a variable as part of the index name of an array. You are NOT dynamically producing php code that would require using eval().) B) Variables cannot start with a number, so you will need to change your concept anyway, C) If you post an example of what your form looks like, someone could directly show you how to simplify what you doing.
-
Without a specific statement of a problem you had when you tried to install it, we cannot help you. The point of a help forum is - you attempt to do something or research something first and it did not work or you could not find the answer yourself. Then when you have an error or a problem when you tried it or you have a specific question that you could not find the answer for, you post the error, the symptoms of the problem, or ask a specific question. Someone with specific knowledge about the error, the symptoms as they apply to the relevant code you are using, or the specific question posts a reply in an attempt to help you. If you are stuck at the point of attempting to install joomla, the answer is "give it a try." If you don't know how to "give it a try" then you must have skipped over reading the installation instructions in the documentation. The reason why someone went to the trouble of writing the documentation is so you would have the means of learning the common information that everyone who attempts to use it needs to know. So, did you have a specific problem or error when you tried to install it or do you have a specific question about installing it (and no, i want ur help to install joomla in my localhost is not a specific question unless you want someone here to come over to where you are at and do it for you.)
-
That's only building a string that has the syntax of a php array statement. $sql = mysql_query("SELECT feed_url FROM sc_feeds"); $feed = array(); // define an empty array while ($r = mysql_fetch_array($sql)){ $feed[] = $r['feed_url']; // add an element to the array } echo '<pre>',print_r($feed,true),'</pre>';
-
[SOLVED] The image cannot be displayed, because it contains errors !
PFMaBiSmAd replied to yami007's topic in PHP Coding Help
You cannot output image data and HTML on the same page. -
$data = fgetcsv($handle, 1000, ","); Yes, the above line of code, right after the fopen() statement is reading and discarding the first line from the file. Why do you have that in your code?
-
Yes, and one thing I was going to add to the above, all the cookies that match the URL being requested via AJAX will be sent to the server on each request, so the existing cookies would be available in the posted code.
-
Because you are generaing a new random number and assigning it to the session variable every time the page gets requested. You should only generate the random number and assign it to the session variable when the form is displayed, not every time the page is requested (when a form is submitted to a page, that causes a request for that page.)
-
If the server is what is setting the cookie (you could set a cookie using javascipt in the bowser), the only requirement is that the header must be sent in a response before any content is sent in a response. The response in question is the one the server sends due to the AJAX http request. The request and response that caused the whole page to be originally displayed is not part of the situation, that request/response completed long ago. You can set a cookie or start/resume a session in the .php code that is the target of your AJAX requests. You can in fact set a cookie/start/resume a session on any request/response, even for something like the request that fetches an image or other media on a page.
-
[SOLVED] Convert Dynamic PHP page to Static HTML
PFMaBiSmAd replied to isedeasy's topic in PHP Coding Help
You would need to include the file using the URL to the .php page, then use ob_get_contents() to capture the resulting output - http://www.php.net/manual/en/function.ob-get-contents.php Then simply write the captured content to the file of your choice. -
post method="get" - empty values in URL
PFMaBiSmAd replied to stylemessiah's topic in PHP Coding Help
You can pass GET parameters on the end of the URL (your pagination values) and use POST variables for your form data at the same time. -
A session consists of two parts, the session id from the browser and the corresponding session data on the server. By default, the session id is passed between page requests using a cookie. Do sessions work without using the DB eSession, because the only thing that it should be doing is to change the session save handler from the built in file handler to a database save handler. There is actually only one real reason for using a database session save handler, when you need to share session data between multiple web servers? Are you planning on doing any load-balanced web servers?
-
file_get_contents doesn't take a variable?
PFMaBiSmAd replied to greenheart's topic in PHP Coding Help
Posting actual error messages is the quickest way of getting a solution to what is causing an error. -
re: HELP FINAL YEAR STUDENT NEEDS HELP WITH PHP AND MYSQL
PFMaBiSmAd replied to jalani86's topic in PHP Coding Help
The same way that you solve any problem, programming or not. You define what you are trying to achieve, then you break the problem down into smaller and smaller steps that lead to a solution that accomplishes the stated goal, until you get to the point where code can be designed, written, and tested that implements each step that will cause that goal to be realized on a computer - http://www.ipbwiki.com/Practical_PHP_Programming:The_design_process What exact problem are you having with some php related code you have written (which is the purpose of this forum - Do you need help with some code you wrote?) -
file_get_contents doesn't take a variable?
PFMaBiSmAd replied to greenheart's topic in PHP Coding Help
file_get_contents($link); is valid, assuming that is an accurate representation of your actual code, because if it had single-quotes around $link, it would not work. -
The most common reason is when your mail server does not have all the correct DNS records (missing or wrong SPF, MX, or A records will get an email voted as SPAM). The second most common reason is what cags posted, a From: address that is not hosted at the sending mail server (if you were a receiving mail server and the From: address could not have come from the actual sending mail server, would you put the email into the 'in' box?). The third most common reason is short messages and subject lines that also contain spam like content (links, spamy words...) Another reason is if your mail server has been used in the past to send spam to the receiving mail server and has been blacklisted or appears on any of the spam databases. All of these things don't really have much to do with finding a 'correct' script to use, but how well your mail server is configured, what you put into the mail header fields, and what you put into the subject and message.
-
There's a table in the documentation and when you do use them as table/column names, your query fails to execute and produces an SQL syntax error (see the mysql_error() function for debugging) where the part of the query that is printed in the error message, starts with the reserved keyword that was found in a context where it does not belong - http://dev.mysql.com/doc/refman/5.1/en/reserved-words.html
-
If the line numbers mentioned in the errors you posted corresponds to the code that is inside of the if(isset($_POST['processFile'])) { logic, then it is likely that your code is overwriting the $_FILES array. Another possibility would be invalid nested form tags. You would need to post your actual code for someone to be able to determine which out of the several possible reasons it is not working.
-
If $_POST['processFile'] is set, but the $_FILES array is empty, it is likely that uploads are not enabled on your server. What does a phpinfo(); statement show for the file_uploads setting?
-
You can do this in the query - http://dev.mysql.com/doc/refman/5.0/en/example-maximum-column-group-row.html
-
[SOLVED] Deprecated: Function split() is deprecated
PFMaBiSmAd replied to dlf1987's topic in Applications
However, for what you are doing, just use explode() again.