-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
php code works and dose not work - confused? take a look!
PFMaBiSmAd replied to gaogier's topic in HTML Help
I'm going to guess that the actual problem you are trying to solve is that the footer section is not present on the http://runehints.com/quest.php page? The html in the 'view source' ends right after the - <center> Most ever online was 979, on 21 April, 2008 at 10:33.</center><br> You would need to at least identify the code responsible for that and the problem code is likely right after that code. -
The name attributes of your form fields are not date and date2. You would need to make sure that the data from the form is being accessed in the php code correctly.
-
get a documents last modified date as integer
PFMaBiSmAd replied to koolaid's topic in PHP Coding Help
A) getlastmod() does not accept a parameter in the function call. Perhaps you meant to use filemtime()? B) Both getlastmod() and filemtime() return a Unix Timestamp. Please make use of the php.net documentation for the function(s) you are trying to use. -
Because you are logically AND'ing the value 'AIDB Region-09' with Account='2' AND Region='9' AND Adult='1' AND Reallocations='0.00' and assigning that to systemName. I suspect you meant to create a comma separated list of columns to UPDATE, rather than AND'ing values.
-
Which is yet another reason why you should write code that will work on all server configurations by not relying on any of the lazy-way (save typing a few characters in a file) short-cuts. People keep wasting hours and sometimes days of time when code is moved to a different server because someone tried to save a minute of typing time. That equates to wasting 2-3 orders of magnitude more time troubleshooting a problem every time you move to a server that does not have short_open_tags enable then was ever saved in typing type. Simply amazing.
-
could someone please help me with my php5.ini file
PFMaBiSmAd replied to Reaper0167's topic in PHP Coding Help
As to your post in the freelance section (normal members cannot post replies in that section), you should try to get godaddy to post their default Windows/iis7 php.ini in their FAQ section as a starting point. Assuming you are developing your php code on a Windows based system, you could use your php.ini from your development system (make sure to set things like display_errors, register_globals, magic_quotes_gpc, magic_quotes_runtime, allow_url_include ... to OFF.) You would also need to set extension_dir, SMTP, smtp_port, session.save_path ... to the correct values (from your existing phpinfo() output) and enable any extensions that you are using (mysql, GD,...) -
could someone please help me with my php5.ini file
PFMaBiSmAd replied to Reaper0167's topic in PHP Coding Help
Edit: Upon examining the godaddy faq information, their IIS7 hosting does support php. What exact type of hosting (shared, VPS, dedicated...) do you have, because the best available information is that shared Windows hosting at godaddy does not support php (even though they have installed php on their Windows servers and some php code will run.) When you contacted godaddy support about this, did you mention to them that your hosting was using Windoes/IIS? The link you posted Yesterday at 06:01:04 PM that contains a link to a godaddy article mentions that the information is for 'Linux Shared Hosting'. You also cannot set the two upload size settings using ini_set() statements in your code. And for the settings you can set that way, like 'memory_limit', the number supplied is in bytes unless you include an M or G to specify a larger value (you most likely were getting a runtime error because ini_set('memory_limit', 100); means 100 bytes.) -
POP3 is the primary protocol that a mail client program uses to retrieve email from a mail server. If you are using Outlook to 'read' email, you are most likely already using POP3.
-
Php can retrieve mail box information and emails using IMAP or POP3 - http://us.php.net/manual/en/book.imap.php
-
Login script, comes up with user does not exsist when it does...
PFMaBiSmAd replied to knifeh's topic in PHP Coding Help
The "user does not exist" message is output when if($password==$password1) is FALSE. Your first step would be to get your indentation under control so that you can see that the logic is not what you think it is. Your next step would be to troubleshoot why the entered password does not match what is in your database table. Echo both values and find out why they don't match. -
You are missing the point of FUNCTIONS. Functions should be general purpose. It should not matter where your $ini_array comes from (parsing a .ini file, a SQLite/flat-file database, a mysql database, a PostgreSQL database ...) If you pass the data into the function as a parameter when you call the function, you can reuse your function in many different applications with the data coming form anywhere you want it to without needing to edit and then retest the code inside the function definition.
-
These two links might or might not help - http://www.php.net/manual/en/mbstring.overload.php http://www.php.net/manual/en/function.mb-strtolower.php
-
Best way of handling include and require paths?
PFMaBiSmAd replied to juanpablo's topic in PHP Coding Help
Use #5 but also use an 'application path' variable (or defined constant) in it that you set/define in your application configuration (config.php) file. Something like - include $_SERVER['DOCUMENT_ROOT'] ."/$app_path/include/connection.php"; You could also add entries to the include_path using set_include_path() and let php search for the files, but if you have a large number of files and several different include locations, performance will be better by specifying the actual path to the files being included. -
irish21, the whole error messages have significance (xxxxxxx out any domain/account/path information you don't want to post.) If you didn't read them or did not think it important enough to post so that someone else could help you, you are wrong. Where the output is occurring at, is what you need to find and fix if you want your code to work.
-
If you are copying this code from a book or a tutorial and the original contains these errors, you have got to ask yourself if this book or tutorial is worth your time. If the errors... typos are a result of your 'translation' between the book and your editor, I've got to tell you that computers only do exactly what their code tells them to do. There is no leeway in coding. Everything must be exact. Everything (including underscores, punctuation...) is there for a reason or it would not be in the code. Also when learning php, developing php code, or debugging php code, please do it on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by displaying all the errors it detects. You will save a TON of time. Stop and start your server to get any change made to the master php.ini to take effect and confirm the settings afterwards in case the php.ini that you are changing is not the one that php is using.
-
session_register() is no longer used and in fact it should not be used with $_SESSION at the same time. Remove the session_register() statements from your code. To find out why your header redirect is not working, 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); Edit: If config.php does not contain a session_start(); statement, you need to add one before you output any content to the browser.
-
The URL might look correct, but because it is broken by spaces and the &, all you are receiving when you click on the URL is the first word (anything up to a 'stop' character.) I was going to suggest echoing your query to see exactly what is in it, but you can see from the error message that your data only consists of the first word because the data in the URL has not been passed through urlencode() Also, if you actually have column names that contain anything other than alphanumeric characters (in the current character set) or an underscore or a dollar-sign, you must enclose those column names within back-ticks ` ` in every query so that syntax of the query is not broken. If you have column names with spaces, &, and commas, you must use back-ticks in the query.
-
Dynamically producing a UNION query is the only way to combine the results from multiple same-structure tables in a single query statement. The only further improvement would be to actually correct the table design to store the related data in a single table.
-
Wow. That kind of missed the point of using a server-side scripting language to reduce the amount of code and work necessary to create and maintain a site.
-
$HTTP_GET_VARS and $HTTP_POST_VARS were depreciated long long ago (php4.1), turned off by default in php5, and completely removed in php6. $PHP_SELF was depreciated long ago (php4.2) when register_globals were turned off by default and completely removed in php6. Also using extract($any_external_variable_here); emulates what register_globals did and allows hackers to set your program variables to any value they want. That code is way out of date (despite the 2007 copyright date), should have been updated or removed from distribution long ago, and is potentially insecure.
-
Your first query - "SELECT * FROM tblVendorSales ORDER BY timeSold" either contains a NULL or an empty string in the articleNumber column. Have you examined your data in your table to see what is occurring? If you intentionally have NULL/empty data, you would need to change the first query so that it does not return rows with NULL/empty values. If you don't intentionally have NULL/empty data values, you would need to determine how they are occurring and eliminate the problem that is allowing NULL/empty values to be inserted in the first place (and remove existing rows that have NULL/empty values now.)
-
Since register_globals have been completely removed in php6, now would be the time to start updating your code to use the correct $_POST, $_GET, $_COOKIE, $_FILES, $_SESSION, $_SERVER, and $_ENV... variable where the data is actually coming from. Register_globals were turned off by default in php4.2 in the year 2002, almost 8 years ago, and finally throw a depreciated error in php5.3 when they are found to be turned on. It is sad that we are still seeing people experiencing problems with their code at this point in time. All code and web hosting that relied on register_globals or had them turned on should have been updated long long ago (8 years in software 'time' is like a couple of decades in human time.)
-
You must have a connection to the database server before you can use mysql_real_escape_string(). Make your connection first. When learning php, developing php code, or in this case debugging php code, please do it on a server with error_reporting set to E_ALL and display_errors set to ON in your master php.ini so that php will help you by displaying all the errors it detects. You will save a TON of time. Stop and start your server to get any change made to the master php.ini to take effect and confirm the settings afterwards in case the php.ini that you are changing is not the one that php is using.
-
option is a reserved mysql keyword. Either rename your column to something else or enclose option in back-ticks `option` in every query.