Jump to content

cyberRobot

Moderators
  • Content count

    2,822
  • Joined

  • Last visited

  • Days Won

    22

cyberRobot last won the day on July 12

cyberRobot had the most liked content!

Community Reputation

107 Excellent

About cyberRobot

  • Rank
    Much to Learn

Contact Methods

  • Website URL
    http://www.cyberscorpion.com/

Profile Information

  • Gender
    Not Telling

Recent Profile Visitors

83,774 profile views
  1. Here's a quick tutorial on the "#" technique mentioned by Barand: https://www.lifewire.com/adding-internal-links-3466484
  2. cyberRobot

    fetch_assoc Select Option value filter column

    Since you are no longer attempting to pass the email address through the online form, which is good, the $_POST['userEmail'] will always be blank. Instead, the email address comes from your database. Try changing this $userEmail = $row["email"]; to this $to = $row["email"]; Note that you will also need to remove the following line: $to = $_POST['userEmail'];
  3. cyberRobot

    Using Post variables in SQL Query for Azure SQL db

    Did you try echoing the following information to see if the query looks correct? $tsql = "SELECT $columnName FROM $tableName"; echo $tsql; If the query looks correct, do you have any alternate way of running the query. Do you have an database admin panel, for example? If so, does the query work there and give you the desired result(s)?
  4. cyberRobot

    Using Post variables in SQL Query for Azure SQL db

    What are the specific errors?
  5. cyberRobot

    Using Post variables in SQL Query for Azure SQL db

    You'll want to look into how sqlsrv_errors() returns the result. More information can be found here: http://php.net/manual/en/function.sqlsrv-errors.php It sounds like the query failed. Did you try to echo out the query to see if it looks like you expect? Side note: in case you're not doing this already, you'll want to look into using prepared statements for queries like the following: $tsql = "SELECT $columnName FROM $tableName"; The values for $columnName and $tableName come from the user. Both have the potential for breaking the query or worse (hijacking it). It's very easy for a person with enough knowledge to modify what gets submitted through a POST variable.
  6. cyberRobot

    fetch_assoc Select Option value filter column

    @parrishpc - When posting code, please use the <> button in your editor so the code appears in code tags. It makes your post easier to read. 😊 As for your question, it looks like your <select> tag is in the same form as the hidden input field for the email address. Assuming that's correct, you'll need to use JavaScript to pull the value selected in the drop down to populate the hidden input field. However, it would be better to populate the drop down values with each person's user ID (as recommended by mac_gyver). Then when the form is submitted to add-email.php you can use the ID to retrieve the selected person's email address.
  7. cyberRobot

    Date time comparisons

    That shouldn't matter. You could run a query to get the first date/time and assign the value to a PHP variable. In your second query you could execute the TIMEDIFF() function where one argument is the PHP variable created earlier. The other argument would be the other date/time.
  8. cyberRobot

    PHP not able to connect to MySQL

    Note that the original post was made several months ago. The OP stopped logging in a few days after the original post.
  9. Note that you can pass the checkbox element to the function using "this". For example: <input type="checkbox" id="myCheck" onclick="myFunction(this)"> The function definition would then look like this <script> function myFunction(checkBox) { var text = document.getElementById("text"); if (checkBox.checked == true) { text.style.display = "block"; } else { text.style.display = "none"; } } </script> Side note: you should use <label> tags to connect your checkboxes with the corresponding labels. For example: <label><input type="checkbox" id="myCheck" onclick="myFunction(this)"> Live Single</label> That way you can click the "Live Single" text to check the box. Also note that I removed the <h4> tags. Those tags should be reserved for actual page headings. Using them for styling purposes causes confusion for people visiting your website with assistive technologies like screen readers. If you need the text labels to appear larger or in bold, you could use CSS on the <label> tags.
  10. cyberRobot

    SQL SQLI

    Just be aware that the POST variables would need to be enclosed in curly brackets with the above code. $q = 'insert into nametable (firstname, lastname) values(' . "{$_POST['fname']}" .', ' . "{$_POST['lname']}" . ')'; Or you could remove the double quotes $q = 'insert into nametable (firstname, lastname) values(' . $_POST['fname'] .', ' . $_POST['lname'] . ')'; In the end, however, it would be better to follow Barand's advice regarding prepared statements. That way you don't need to worry about the query breaking when someone with an apostrophe in their name shows up. Prepared statements will also protect you from SQL Injection attacks.
  11. cyberRobot

    Manipulate a single value in an array

    What have you tried?
  12. cyberRobot

    Hi Folks!

    Welcome Kev!
  13. Moving topic to Applications and Frameworks > Applications, since the post is about WordPress. @dil_bert - When posting a topic, please review the list of forums available on PHPFreaks before posting in Miscellaneous. If you have a programming question involving Perl or Python, for example, we have an Other Programming Languages forum. There is an Editor Help forum for questions about IDEs.
  14. cyberRobot

    cannot modify header information

    As ginerjm mentioned, nothing can be outputted to the screen before calling the header() function. Note that your level1.php script has several lines of output at the top. The script will need to be rewritten so that you do all your processing at the top. Then all of the output would be done at the bottom of the script.
  15. cyberRobot

    buttons not aligning at the center

    I'm not sure why, but JavaScript seems to be having a difficult time with the function being named "stop". It worked with your older code, but when the <form> tag is moved to encompass the <span class="timer_display"> tag, JavaScript no longer recognizes "stop" as a function. I'm guessing that "stop" is reserved word in JavaScript and is likely causing weird problems like this. When I change the function name to "stopTimer", remember to change the function call in the <button> tag also, the script magically works again. Side note: you'll want to look into JavaScript's clearTimeout() feature. More information, including an example, can be found here: https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.