-
Posts
3,145 -
Joined
-
Last visited
-
Days Won
37
Everything posted by cyberRobot
-
Getting the error Undefined index but the column exists
cyberRobot replied to makamo66's topic in PHP Coding Help
Serious question: is that case for every variable? $name should definitely be inserted using a prepared query since that contains a value supplied by the user. What about the date? If it's a date that supplied by the user, it should go through the prepared query. However, what if the date is generated by the server / script? -
Perhaps this will help: https://help.sender.net/section/api-integrations/
-
Constant Contact has one here: https://developer.constantcontact.com/docs/developer-guides/api-documentation-index.html Here's another for MailChimp: https://mailchimp.com/developer/ I should mention that I don't spend much time with these services. I've only used them to set something up for others who are responsible for sending out mailings. Both services have work well for the project needs. Note that I haven't used either of the aforementioned APIs.
-
Loading and playing sounds dynamically off the server.
cyberRobot replied to ajoo's topic in Javascript Help
I haven't used Audio() myself, however, the documentation found at the following link contains an example with an event listener for "loadeddata": https://developer.mozilla.org/en-US/docs/Web/API/HTMLAudioElement -
i need to implement this code in the script
cyberRobot replied to user7654321's topic in PHP Coding Help
Did you write the script? If not, you might want to look into an alternative solution. For example, user-supplied information like what comes from $_POST['username'] should not be placed directly into the query. You will want to use prepared statements to prevent someone from performing SQL Injection attacks. You should also look into a solution that uses password_hash() for hashing passwords. More information about hashing passwords can be found here: https://www.php.net/manual/en/faq.passwords.php -
Yeah, I just noticed that after reading your post. I didn't notice the output discrepancy until after making my post. I was in the middle of writing something when your post came through.
-
Based on the initial code above, $srs is passed to the output() function. In that function, the passed value from $srs is now stored in $obj, since that's what you named the function argument. Due to variable scope, $srs isn't going to be available in the function. However, you can use $obj to refer to the information. That's the variable you would use to perform the loop and output the data as you see fit.
-
Do you, by any chance, have any backups of the database? Perhaps you could look through those backups for what was changed before. If you don't have any backups, are you using a third-party website host? If so, have you checked with them on any backups?
-
$srs is an array of arrays. To use implode(), you'll need to loop through the outer array. Then you can use implode() to output the section information.
-
php only works when i’m logged into wordpress.
cyberRobot replied to davidhb21l6's topic in PHP Coding Help
Try adding a test line before your if statement. For example: <?php $url = $_SERVER['REQUEST_URI']; print 'HERE'; if ($url =="/thankyou/") { Does "HERE" appear on your pages when you're logged out...and in? For what it's worth, the PHP code in your if statement only gets executed when you're on the "/thankyou/" page. Is that page only displayed when you are logged in? -
There's a lot of potential steps in that description. Where are you stuck? Do you have any code?
-
Are you looking to count what you get from the following line? $lis2 = $html2->find('.chunklist', 0)->children() ; If so, have you tried PHP's count() function? count($lis2) Note that I haven't used PHP Simple DOM. So I'm just guessing here. ?
-
Stop showing profiles on hover?
cyberRobot replied to ginerjm's topic in PHPFreaks.com Website Feedback
Out of curiosity, I tweaked the style sheet in my browser for a couple pages on the PHPFreaks website. I personally think the links look fine with them all underlined. An example screenshot is attached. -
Stop showing profiles on hover?
cyberRobot replied to ginerjm's topic in PHPFreaks.com Website Feedback
I'm right there with you. I understand the impulse to style links so they fit with the design or don't stand out too much. Especially when dealing with pages that contain a lot of links. However, I'm still in the boat where links should be underlined, for the most part. Of course, I make exceptions for things like the website navigation and text designed to look like a button. A benefit of using underlines, besides the easy recognition for most website visitors, is that it helps people who have difficulties perceiving color. In case anyone reads this and is interested, more information can be found here: https://webaim.org/techniques/hypertext/link_text#appearance -
Stop showing profiles on hover?
cyberRobot replied to ginerjm's topic in PHPFreaks.com Website Feedback
It seems like that could lead to some confusion. There's nothing obvious in the popup for getting to the user's profile. Perhaps that something that can be changed. If someone clicks a username to bring up the popup, I don't know if visitors will think to click the username again to view the profile. -
Stop showing profiles on hover?
cyberRobot replied to ginerjm's topic in PHPFreaks.com Website Feedback
Sorry, I read your post incorrectly. I could see how that would be annoying. Moving the mouse to hide "popup" content seems to be par for the course when it comes to browsing the Web. I guess I've just gotten used to it. -
Stop showing profiles on hover?
cyberRobot replied to ginerjm's topic in PHPFreaks.com Website Feedback
I personally like the hover feature. It's especially useful for previewing topics when looking for spam. Luckily the hover action has a few second delay. I'm not a big fan of fighting with "popup" windows as I'm trying to interact with the website. -
Good to know, thanks ?☺️
-
I should mention that you'll want to use caution when you get to the step where you are populating the $extensions array using form input. Information supplied by a user should never be trusted. Forms, for example, can be tampered with, even ones using the POST method.
-
In case this is more than just test code, the above code is missing the closing tag for the table row. As for the error, $array isn't defined in your code. Assuming that you are looking for extensions 201, 201, and 204, try something like this $extensions = array(201,202,204); $sql = "SELECT extension FROM extensions where extension IN(".implode(',',$extensions).")"; Note that you'll need to run the query, like you did for the extensions HTML table. The foreach loop that runs through the phone numbers can be replaced with a while loop, like you have for the HTML table.
-
What does your code look like now? Is $array defined...before the query?
-
Interesting. That would explain why the OP didn't need to write a script to force the browser to download the file. I'll have to try out the attribute sometime. Thanks!
-
You might get a better response if you post the pertinent code here. Just make sure to use code tags (which is the <> button in toolbar when posting). Have you looked into using something like PHP's natsort() function? More information can be found here: http://php.net/manual/en/function.natsort.php