-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Php code in a .php file cannot be seen outside of the actual file on the server. HTTP requests for the file only result in any output from that file. Unless you echo your password in your php code or php no longer works, it is safe to put passwords in a .php file as php code. Making a HTTP request for the file simply wastes server resources serving up a .php file that doesn't output anything. If you do put your included files inside the document root folder (i.e. for server setups where you cannot put files outside of the document root folder), you typically put all of them into a common folder and then use a .htaccess file to prevent all HTTP requests for the files in that folder.
-
The forum's menu button you used to highlight your php code is for making links to the php manual section for php keywords. Just use the forum's bbcode tags for php code. $HTTP_POST_FILES was depreciated a really long time ago, turned off by default in php5.0, finally throws a depreciated error in php5.3, and is completely removed in php5.4. Use $_FILES instead of $HTTP_POST_FILES
-
php string variable in a html form value parameter ?
PFMaBiSmAd replied to Frank74's topic in PHP Coding Help
Text areas don't have value='' attributes. The text goes in between the opening and closing tag - <textarea>content gets echoed here...</textarea> -
Examples can be found posted all over the Internet. Search for - javascript calculate form fields
-
My PHP script is sending blank emails.
PFMaBiSmAd replied to MikeBrando's topic in Third Party Scripts
You are getting blank emails because your form processing code is not testing if a form has been submitted at all and it will send an email every time the page is requested (when there is no submitted $_POST data, for your first posted code, because it at least was testing the submitted data.) This will occur every time a search engine indexes your site or a spam bot script requests your form processing page. At a minimum, you must do the following - <?php if($_SERVER['REQUEST_METHOD'] == "POST"){ // all your form processing code goes in here, including the mail() statement. } ?> You also need to validate ALL the external data before using it. -
I recommend that you play computer and proofread your code and comments in your code to see if it is logically doing what you expect.
-
The comment above each function doesn't match what the code is doing in each function, which also results in the wrong array element number being accessed by the code in each function.
-
Best guess is that in the code that is before the code you did post, you are fetching and discarding the first row from the result set. Posting all the code from the query through to the end of your loop is the best way of getting the quickest solution. The code you did post is also producing errors on the last pass through the loop because of the equal comparison in the loop condition (and that you are starting the loop at zero.) You should only be using less-than < You should also have php's error_reporting set to E_ALL and display_errors set to ON so that php will help you by reporting and displaying all the errors it detects.
-
Ummm. That's not equivalent to the logic that was given.
-
$_SERVER['DOCUMENT_ROOT'] will give you the absolute file system path to your document root folder (kind of why they named it what they did.) You can then append (concatenate) your path/filename.ext on to that to produce an absolute file system path that will work regardless of which file actually includes your file. If that doesn't accomplish what you want, you can use the include_path setting to get php to search for your include files in specific folders.
-
include()'ed html file not displaying img's
PFMaBiSmAd replied to cedricganon's topic in PHP Coding Help
A leading slash on a link/URL refers to the root of the domain (i.e. a domain relative link/URL.) All the URL's you have shown in your post are trying to find the file starting at your domain root - http://yourdomain.com/images/picture.jpg http://yourdomain.com/dir1/dir2/images/picture.jpg Relative URL's either start with a dot or double-dot or are just the filename. -
Trying to get property of non-object (Newbie)
PFMaBiSmAd replied to etherboo's topic in PHP Coding Help
old thread... -
If you want help with some specific code you tried, you would need to post it along with some sample data. Also, state what didn't work when you tried it.
-
how to make the session login both user and admin can be view
PFMaBiSmAd replied to shebbycs's topic in PHP Coding Help
The assignment operator is one = sign. The equal comparison operator is two == signs. If you are trying to assign a value to a variable, you use one = sign. -
You would use GROUP BY Season
-
Someone (me) posted a link to a thread showing how to do that (you remember the title and output a new heading when the title changes.) An equal comparison is two == (an assignment is one = sign) You have an if() statement using one = sign, instead of two ==. What format is your startDateTime value?
-
You should NOT have a separate page for each different category/product type, where the only thing that changes is the actual data you are operating on. You are making more work for yourself and by having so much duplicated code spread out in several pages you cannot see the forest for the trees to add on one more category. What you need to do is have one page that accepts a ?category=x (x=1,2,3,...) get parameter on the end of the URL that tells the code on that single page what the page should do. Edit: You also mentioned CSV several time. There's nothing in your hundred's and hundred's of lines of code having anything to do with a CSV data (that I can see - i.e. the forest for the trees problem.)
-
benchew0904, whomever assigned this, probably wanted you to send the reminder email once, a specific number of days ahead of when the appointment is scheduled? Also, your appointment_date column needs to be a mysql DATE data type so that you can perform the date check in the query. The 24/12/2011 format cannot be directly used by mysql. Edit: Also, if for some reason your code doesn't send out a reminder at the intended time (your code didn't run for some reason, email could not be sent for some reason, ...), what do you want to do? Keep trying and for how long?
-
Need some help with the include statement on xampp 1.7.7
PFMaBiSmAd replied to m1k3yb0y's topic in PHP Coding Help
Cannot help you without the code that is responsible for the symptom. Someone already posted the three possible types of URL's to use. It is up to you to make sure that each element in the type of URL that you are using is correct. Usually, the path to the image is incorrect. -
http://dev.mysql.com/doc/refman/5.5/en/example-maximum-column-group-row.html
-
If you search for (the keywords in) that error message, you will find that it generally means that your query failed due to an error of some kind. There are a couple of other possibilities, depending in what your actual code is (it always pays to post enough of your actual code the reproduces the problem.) For debugging purposes, use the following for your mysql_query statement - $rsd = mysql_query($sql) or die("Query failed: $sql<br />Error: " . mysql_error());
-
There are multi-byte string functions - http://us3.php.net/manual/en/ref.mbstring.php
-
No. The first one tests if there were any rows returned by the query, which also indirectly detects that the query executed without any errors. The second one only tests if the query executed without any errors. There can still be zero rows in the result set at your // do something point in the code.