-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
The characters are part of the file and are at the very beginning of the saved file. They are put there by editors when they detect a file contains UTF-8 encoded characters. Using notepad++, there is an 'Encoding' menu in the top menu bar. When you open your file, it should show the 'Encode in UTF-8' item selected. Pick the setting right above that one, 'Encode in UTF-8 without BOM', and save the file.
-
$_GET problem when using $GET['screen_check']
PFMaBiSmAd replied to python01's topic in PHP Coding Help
Most of the problem is because $PHP_SELF was depreciated over 10 years ago, throws a depreciated error in php5.3 when turned on (where the depreciated error was introduced), and has been completely removed as of php5.4. Also, the current variable to reference php_self - $_SERVER['PHP_SELF'] seems to randomly change without any documentation between having and not having the get parameters as part of it. You need to build the URL in your javascript differently. Since your code has the $_GET['ID'] in $PropertyID, why not deliberately build the URL using that - echo "<script language='JavaScript'> <!-- document.location=\"?ID=$PropertyID&screen_check=done&Width=\"+screen.width+\"&Height=\"+screen.height; //--> </script>"; -
Is the following what you are trying to do: you want to put hyphens '-' in your urls, where your data actually has spaces and you want the submitted url (with hyphens) to match the spaces in your actual data?
-
That sounds like MS Notepad. If your file only contains ASCII characters, you can use the ANSI selection. If you have UTF-8 encoded data, don't use the ANSI selection. You should not try to use MS Notepad as a programming editor. I recommend using Notepad++. It will allow you to save your file without the BOM characters.
-
The  characters are the utf-8 Byte Order Mark (BOM) characters. I'm guessing you have opened the file in your editor and it got saved with the BOM. You need to save the file without the BOM characters. Your editor should have a choice under the 'save as' menu or under a character encoding menu to save the file without the BOM.
-
How are you building these links? Do you actually have matching data in your database table? For a specific example, 'corner-tv-unit', what is the data in your two database tables that you expect the query to match? Perhaps for that specific name, your join query doesn't have a matching entry in the furniture_groups table? Edit: I just tried your rewrite rule and your example link and the correct value is received in the computerdesks.php file as the name, so this has nothing to do with that part of the process.
-
Something tells me that when you added the database user to your database, you didn't select CREATE TABLE privileges. What exact error, symptom, or information do you have that leads you to believe that your web host doesn't allow CREATE TABLE queries to be used in a php script? And if your web host is the Bluehost you have previously mentioned, they have a FAQ that specifically states -
-
This topic has been moved to PHP Freelancing. http://www.phpfreaks.com/forums/index.php?topic=361245.0
-
If you are getting emails with time values in them that are 6 minutes apart, then your script is being executed multiple times. You are either requesting/refreshing the page again or you have a cron job/scheduled task that is requesting it with a 6 minute interval. The counter WILL be the same value for any particular email address. All the "John" emails will have a count of 1, all the "Mary" emails will have a count of 2, and all the "Rob" emails will have a count of 3. If you mean that ALL the emails have the same count, I doubt it. What exact count values are you getting at each test email address? Edit: The last code you posted above is setting the $sendContent variable AFTER you have used it in the $mail->MsgHTML() method. So, the first email to the test "John" account isn't going to contain any message body. I recommend re-ordering your code so that it assigns the string to $sendContent before it calls $mail->MsgHTML().
-
What exactly is happening? Are you getting your - 'Your request was not submitted, please contact NewLeaf Delivery' message or your "Your request has been received" message?
-
how to split results into page 1,2,3 etc...
PFMaBiSmAd replied to andy_b_1502's topic in PHP Coding Help
^^^ That's not all the code in your script that can affect the value in $pn. -
how to split results into page 1,2,3 etc...
PFMaBiSmAd replied to andy_b_1502's topic in PHP Coding Help
It would be - echo $query2; Also, the query statement you just posted has an extra comma after the ASC keyword that is incorrect and is not present in the query statement in your actual code. The query you posted above also wont work because $limit hasn't been defined. You need to troubleshoot the actual query statement in your actual code. -
how to split results into page 1,2,3 etc...
PFMaBiSmAd replied to andy_b_1502's topic in PHP Coding Help
That means that the query failed due to an error of some kind. You would need to debug why your query is failing. Echo $query2; to see exactly what the query statement is and echo mysql_error(); to get php/mysql to tell you where in the query it found a problem. -
how to split results into page 1,2,3 etc...
PFMaBiSmAd replied to andy_b_1502's topic in PHP Coding Help
What goes between the query and the while loop? The only problem is - All you would need to do to fix that is to look at your code and put the correct result resource from the query with the LIMIT clause in it, into the while(){} statement. -
how to split results into page 1,2,3 etc...
PFMaBiSmAd replied to andy_b_1502's topic in PHP Coding Help
The query result resource that you are looping over, isn't the one from the query with the LIMIT clause in it. The query result resource you are looping over is from the query that is getting the total count of matching rows, which you aren't actually using to get the total count of matching rows from. -
Are you sure the duplicates you are getting aren't the result of previous testing? Change the email content in some way each time (perhaps put the date/time into it) so that you know which emails are from any particular execution of your script. With the ClearAddresses() statement in your code (in your first post, I didn't actually scroll down to see that), the code should only send one mail to each address. Are you sure that is your actual code being executed on the server? If the email body is going to be the same for all recipients, you would generally use a list of BCC: addresses to send the same email to multiple recipients, while hiding the list of addresses from each recipient.
-
The AddAddress() method keeps adding addresses to the list of TO: addresses (so that you can send the same email to multiple TO: addresses.). You would need to call the ClearAddresses() method to clear the list of TO: address(es).
-
http://us3.php.net/manual/en/types.comparisons.php
-
Need to store temporary data but from multiple sessions
PFMaBiSmAd replied to n1concepts's topic in PHP Coding Help
You are way over thinking this. You are basically making a session based 'cart', where the items in the cart are product id's that you are going to print labels for. You would just store the searched for id's as array entries under a specifically named session variable. In general, you would use the product id as a key of an array, so that you can, if needed, store and access specific information using that key, such as a quantity or an array of product information. <?php // add to session - $key = 123; // some product id $_SESSION['cart'][$key] = true; // using true just as a flag, you can assign any other value, such as maintaining a quantity or even an array of values. You can either loop over the $_SESSION['cart'] array or you can use array_keys($_SESSION['cart']) to get just the ids. -
Need to store temporary data but from multiple sessions
PFMaBiSmAd replied to n1concepts's topic in PHP Coding Help
SESSION data is unique per client (browser.) Each session gets a unique session id, that the browser provides with each request it makes to the server. The name `session' is derived from 'browser session'. -
If your comparison is actually if(TRUE==999), rather than the previously stated if (1==999), then yes, TRUE is == to 999.
-
Cannot work out PHP Sessions and trying to call session values!
PFMaBiSmAd replied to colleyboy's topic in PHP Coding Help
You also need an exit; statement after the header redirect in that code to prevent the remainder of the code on your 'protected' page from running. All a hacker needs to do is ignore the header() redirect and he can access your 'protected' page the same as if that code wasn't even there. -
Also, the only relevant code that you needed to post is the code that the error message is referring to, so lines 1-3.
-
You are probably not seeing any error message from the echo .... mysql_error() statement, because your page is redirecting and you likely have output_buffering turned on in your php.ini. Is the URL in your browser for the page where your INSERT query is on or is it for the register_success.php page? For debugging purposes, temporarily add an exit;/die; statement (or put the msyql_error statement inside of a die() statement) so that you know what execution path your code is actually taking. Also, you should not redirect to the register_success.php unless you have tested that the INSERT query actually executed without any errors and that it inserted the row into the table. See: mysql_affected_rows
-
Without all the code that reproduces the problem, including your _log() function, it's not directly or quickly possible to help you find what the problem is. If you don't want to post all your code that reproduces the problem, make up a sub-set of the code that still produces the problem when you run it, then post all of that sub-set of code. I'm guessing your _log() function has some variables brought into it using the global keyword that are part of that class and they don't exist when you call that function outside of the class.