boompa
Members-
Posts
305 -
Joined
-
Last visited
-
Days Won
1
Everything posted by boompa
-
This version of PHP is way too old (end-of-life was over 5 years ago!), and therefore insecure. Version 5.5 is going to reach end-of-life in a few months. You need to upgrade to one of the supported versions: https://secure.php.net/supported-versions.php
-
You need to learn how to read errors and warnings, as these are perfectly clear: Why is the getProperty2 method setup to take an argument? It looks like you copy/pasted the function for setProperty2() and forgot to remove the argument.
-
Use explode.
-
Use wordwrap on the output: https://secure.php.net/manual/en/function.wordwrap.php
-
How Do I Revise Old Code To Work In New Version?
boompa replied to spock9458's topic in PHP Coding Help
Congratulations! Your super-crappy host has updated PHP to a version that is no longer supported after last year. You need to find yourself a *real* host that supports at least 5.5, move your code there and do the updating required in your code. -
Please move your code to use something other than the deprecated mysql_ functions (mysqli or PDO) and use prepared statements. You are totally open to SQL injection attacks.
-
The ; at the end of this line if(!preg_match('/[a-z]/',$title)); means the if statement will have no effect, and the line immediately following will always be executed.
-
php crypt with same salt returns same crypted string, why?
boompa replied to colap's topic in PHP Coding Help
The answer is right in the documentation: You should be using the password_hash function.- 1 reply
-
- 2
-
To get a valid WSDL from that location you need to append ?wsdl to the url: https://api.mindbodyonline.com/0_5/SaleService.asmx?wsdl
-
You are making a mysqli instance here and assigning it to the variable $db: $db=new mysqli('localhost', 'DanCojocaru', 'danutzsrl', 'dan cojocaru'); Therefore, you should be calling the query method on *that* variable, $db.
-
Don't use Pear; as you can see the last stable release was over 5 years ago. Use either Swiftmailer or PHPmailer.
-
PHP XML Import script error - simplexml_load_string and xpath
boompa replied to craigt's topic in PHP Coding Help
Try setting the curl option CURLOPT_FOLLOWLOCATION to true. Looks like there's a redirect occurring now. -
Something else for you to read. Or, you could use the Sentinel library, or perhaps Aura.Auth. The point is, really, not to try to re-invent the wheel...especially in such a critical component.
-
how to consume Asp.net webservices from Php client
boompa replied to Jaiboon_Nisha_Ali's topic in PHP Coding Help
So, use SOAP. -
get_magic_quotes_gpc() function is deprecated? some help please
boompa replied to afrikdeveloper's topic in PHP Coding Help
Use PDO or mysqli and prepared statements. Read the manual entry. -
Might want to double-check the argument to date in this line: ':date' => date('Y-m-y H:i:s'),
-
PHP/VB encryption API cross-platform compatibility
boompa replied to Pmedwards25's topic in PHP Coding Help
You can use mcrypt with AES in ECB mode. -
You will make your mailing life easier if you take the time to learn how to use a third-party mailing library like PHPmailer or Swiftmailer and take advantage of them.
-
Good for you for moving to PDO. Now, read the manual page for PDO's query() method. Note the following in in the Return Values section" . You do not account for the fact that your query can fail before you go trying to use it in your foreach loop. I note also that you can't necessary be blamed for this, because the example provided in the documentation does the same. Better would be something like the following, at least until you're sure you've got the query right: $result = $pdo->query(); if ($result === false) { die(print_r($pdo->errorInfo())); } // Successful query foreach($result as $row) { // Do your output }
-
can’t get the Exception to display an error message.
boompa replied to Supervan's topic in PHP Coding Help
Assuming the query function being called is the one you posted (which doesn't necessarily make sense because it looks like both of these functions are in the same class, but you're invoking the query function on $this->_db rather than $this), you are returning $this from your query function, which shouldn't be falsy. -
You probably want to use socket_getpeername() on the accepted socket to get the remote IP address.
-
Perhaps this will help you: <?php $xml = simplexml_load_file('radio.xml'); print("Day: {$xml->DayData->Date}\n"); foreach($xml->DayData->Rotation as $rotation) { print("\tRotation Time: {$rotation->Time}\n"); foreach($rotation->SpotData as $spot) { print("\t\tTitle: {$spot->SpotTitle} Length: {$spot->Length}\n"); } } Running this code on the command line results in: php -f radio.php Day: 2015-05-11 Rotation Time: 6a - 7p Title: Biore Length: 30 Title: Motel 6 Length: 30 Rotation Time: 6a - 7p Title: Biore Length: 30 Title: Motel 6 Length: 30 Rotation Time: 6a - 7p Title: Sprint/Boost Promotional Offer Length: 60
-
stream_socket_client overwriting remote_host parameter
boompa replied to decogd's topic in PHP Coding Help
Why not use their API? -
There's an example right on the documentation for wp_login_url, under "Default Usage".
-
That would seem to indicate that the problem is the $memberid variable is not matching the result members you're testing.