-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
cant get cookies to work, getting frustrated.
PFMaBiSmAd replied to turkman's topic in PHP Coding Help
The output that was started at or before line 9 in top.php - -
The $_POST['...'] variable would match your <select name="..." attribute - $_POST['DogID']
-
cant get cookies to work, getting frustrated.
PFMaBiSmAd replied to turkman's topic in PHP Coding Help
Add the following two lines of code immediately after the line with your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL); -
cant get cookies to work, getting frustrated.
PFMaBiSmAd replied to turkman's topic in PHP Coding Help
Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON so that all the errors that php detects, like a header error that would prevent cookies from working, will be reported and displayed? You will save a TON of time. -
echo "<option value=$nt[id]>$nt[name]</option>"; ^^^ This is the code that is using what you retrieved from the query. I only see an 'id' and a 'name' field, neither of which is what you actually selected in the query.
-
If you are referring to the query in the start of this thread, you are selecting url,ref, but those fields are not what you are using in the rest of the code.
-
The code you posted does not produce that error. Any chance when you uploaded it to your server that the upload failed and only part of the file exists on your actual server?
-
mysql_select_db() could be failing if "report" is not your database name or the permissions are not set for the user you connected with. You can also put some error checking logic in your code to make sure - if(!mysql_select_db("report", $con)) { die('Could not select db: ' . mysql_error()); }
-
You can mark threads Unsolved as well.
-
You already have a thread for this. Why start another one? You do understand that the purpose of the <?php and ?> tags are to delimit php code on the page. You can put them anywhere you want as long as the result makes sense.
-
You are using a URL in the include. If you are attempting to include content on the same site, you should use a file system path instead of a URL (the include will operate about 50-100 times faster.) In order to use a URL in the include, both the allow_url_fopen and allow_url_include settings must be on.
-
Not seeing the $_SESSION['username'] 1st time round
PFMaBiSmAd replied to freelance84's topic in PHP Coding Help
It sounds like you are switching back and forth between urls that have and don't have www. in them and you have not setup the session.cookie_domain setting to match all variations of your domain and/or you have some header() redirects that don't have an exit statement after them and your code that is being executed on a page after the header() redirect is modifying the session variables. -
Help with a php mysql query problem - error
PFMaBiSmAd replied to jj20051's topic in PHP Coding Help
The error message is telling you where mysql found something in your query that was out of place and could not be operated on - Create, as you might imagine, has special meaning to a database - http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html Either rename your column to something else or enclose it in back-ticks `` every time you put it in a query so that it will be treated as a column name instead of a keyword. -
A) The image you posted is using Basic HTTP Authentication. B) Using curl on your server to log in won't allow the visitor to - Which, I am guessing is why you are still getting the "Authorization Required" prompt. Using curl logs your server in. It does not log in the visitor. You could log in using curl, retrieve the data, and directly output it to the visitor. You can however, put the username password in the URL (when using Basic HTTP Authentication) and it will log them in when they are redirected to that page. This does however expose the username and password, which you might not want to do.
-
Parse error at end of file with no description?
PFMaBiSmAd replied to morocco-iceberg's topic in PHP Coding Help
Hard-coding something means to write line after line of same/similar code that only differs in value or name and then you must edit that list of code in order to add or change anything, instead of factoring out the common processing and using a loop to accomplish the same thing. An example would be producing a form and processing the form data. Instead of writing out all the lines of the form (hard-coding the form), you could use an array to define the form fields and then simply use a loop to produce the form and then use a similar loop when validating and processing the form data. Here is one example where probably a couple of hundreds of lines of code was reduced to a couple of tens of lines of code - http://www.phpfreaks.com/forums/index.php/topic,303004.msg1433644.html#msg1433644 -
Parse error at end of file with no description?
PFMaBiSmAd replied to morocco-iceberg's topic in PHP Coding Help
All you likely did was to create a more serious syntax error earlier in the file and it isn't even reaching the point that was causing your original error. -
Parse error at end of file with no description?
PFMaBiSmAd replied to morocco-iceberg's topic in PHP Coding Help
You must have some idea what you changed in the code at the point in time it went from parsing without any errors to the present error? -
Parse error at end of file with no description?
PFMaBiSmAd replied to morocco-iceberg's topic in PHP Coding Help
LOL, all that code looks suspect (it's repetitious, hard-coded, nondescript variable names...) -
Parse error at end of file with no description?
PFMaBiSmAd replied to morocco-iceberg's topic in PHP Coding Help
Nope. That block of code does not produce a parse error (after you eliminate the first few lines that were part of a previous string.) A) I don't know what anyone would be doing putting 4000+ lines of code in one file. B) Before you attempt to work on a project that was made up of that many total lines of code, you need to develop some modular programming and organizational skills. Breaking a large project into smaller pieces would also allow you to test each individual section and you would not be faced with a - "my 4000+ line file contains a parse error and I cannot find it." -
finding a value in a field which contains an array
PFMaBiSmAd replied to glennn.php's topic in MySQL Help
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_find-in-set -
The fact that you started a new thread for this problem when you already have a thread, means that you lost all the information you already posted, such as the code you have tried, where this works and does not, and that it is using session variables. Some reason you did not continue with your existing thread?
-
Your data and query works for me (just tested.) You likely have some non-printing characters as part of the data, such as a cr/lf. How did the data get put into the table?
-
Why is it saying that this variable is set?
PFMaBiSmAd replied to aeroswat's topic in PHP Coding Help
Except for check-boxes and radio-buttons, all form fields defined in a form are set, even if they are empty. Try the empty function instead. You would typically use isset to test if the form itself was submitted by checking if the submit button's name is set. -
You cannot use a function to supply a default value. From the mysql documentation - The disclaimer from the bottom of the w3schools web page - You can cause the current datetime to be entered into a column if you use a TIMESTAMP data type -