Jump to content

Balderick

Members
  • Content Count

    75
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Balderick

  • Rank
    Newbie

Recent Profile Visitors

5,214 profile views
  1. and here you have the output of the script: X:mylocation\test-forumpost.php:15: array (size=36) 0 => string 'HTTP/1.1 302 Found' (length=18) 1 => string 'Location: https://www.facebook.com/thisisnothingbutcrap' (length=55) 2 => string 'Vary: Accept-Encoding' (length=21) 3 => string 'Content-Type: text/html; charset=UTF-8' (length=38) 4 => string 'X-FB-Debug: H2nqcWjKt6OFa3H/7fqtn4AmaBe8bs8XU7D8p5iiBbjfIFxKPFk0AXrzmYcsb1j6CQpEAr1WWY+BMO7chtE4vg==' (length=100) 5 => string 'Date: Thu, 10 Aug 2017 08:20:45 GMT' (length=35) 6 => string 'Conne
  2. this is a part of the code: <?php $url_inp = 'http://www.facebook.com/thisisnothingbutcrap'; $array = get_headers($url_inp); $string = $array[0]; // if( strpos($string,"200") || strpos($string,"301") || strpos($string,"302") || strpos($string,"403") ) { if( strpos($string,"302") ) { var_dump($array); var_dump($url_inp); var_dump($string); } ?>
  3. Can someone give any suggestion how to check if a facebook address is valid when send by form input? I created a function checking the url address with get_headers at status code 302. This doesn't work when a facebook username doesn't exist, because it still gives true. How to solve this problem?
  4. The error is like this: Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 unrecognized name in ..... it concerns the line with: $array = get_headers($url); the url input is: if I change htttps to http then I dont have any error messages. I would like to find a way to check in advance what kind of url is put in to avoid the error messages. Anyone got any idea?
  5. I made a piece of code to check wheter a url page exists. This is a part of the get_headers routine I'm using: <?php // check with checkdnsrr // validate with FILTER_VALIDATE_URL /////////////////////////////////////////////////// // get_headers part $array = get_headers($url); var_dump($array); $string = $array[0]; if( strpos($string,"200") || strpos($string,"301") || strpos($string,"302") || strpos($string,"403") ) { var_dump($url); } else { echo '&
  6. I decided to go for routine 1and luckily the errors are gone, but the script does not give a result yet. I commented the addeventlistener line and the placed onSubmit in the form tag. <!DOCTYPE html> <html> <body bgcolor="grey"> <center> <br><br><br> <div style="height: 200px; width: 600px; border: solid 2px blue;"> <form id="my_form" action="" method="post" onsubmit="submitForm(event)"> Give your name: <input type="text" name="fname"> <br> <input type
  7. This is the script right now: <!DOCTYPE html> <html> <head> <script> // Add a submit event handler to the form var form = document.getElementById("my_form"); form.addEventListener("submit", submitForm, false); // error function submitForm(e) { // Cancel form submission e.preventDefault(); // // Build a query string from the form data var form = e.currentTarget; var query = "", element; for(var i = 0; i < form.elements.length; i++ ) { // error element = form.elements[i]; if(element.name) { query += encodeURIComponent(
  8. I changed that, but it throws a new error like this: TypeError: form.elements is undefined it has to do with this line: for(var i = 0; i < form.elements.length; i++ ) {
  9. Ok thanks for clarification Ingolme I used this form to implement it: <!DOCTYPE html> <html> <body bgcolor="grey"> <center> <br><br><br> <div style="height: 200px; width: 600px; border: solid 2px blue;"> <form id="my_form" action="" method="post"> Give your name: <input type="text" name="fname"> <br> <input type="submit" value="Send" onclick="submitForm(e);"> <!--<button type="button" onclick="submitForm(e)">send it</button>--> </form> &
  10. Thank you for the answer. Like I said I have not much experience with javascript and I have a lot of questions. With a lot I mean A LOT. I counted 10, so be prepared. I still gonna ask them, I hope your explanation clears a lot. - Which events have which sequence? (in response to: e.PreventDefault) - What is the use of e.CurrentTarget? - With which reason is the query variable made? - Is EncodeURIComponent a way of sanitizing/validation? o Is it (EncodeURIComponent) obliged (strongly recommend
  11. Hello, I have a question about how to send form data to the database, without reloading the entire page. I discovered working with xmlhttprequest. I managed to show text from another file by implementing a javascript function with xhr into my script. I don’t know much about javascript and don’t understand how a javascript form should be added to an existing function. Finally this should run a php script executing the code to add the form data to the database. <!DOCTYPE html> <html> <body bgcolor="grey"> <center>
  12. This I hear from the beginning I started php programming 2 years ago. But this a recommendation. A strong recommendation I presume, but does this say that everyone just follows these rules, or, that, it is not possible? The answer is no. Would you, therefore, not use mysqli and sanitize and validate all input in a proper way? I'm curious what your opinion is about that!
  13. Hi can someone explain how to create a mysql database in php using OOP prepared statements. I know how to do it with mysqli but I want to know if it can be done with placeholders and oop. a good and clear tut about is okay, but please provide a clear tut about using placeholders and prepared regarding CREATING a new database.
  14. 1) I have login scripts working in combination with database table and verify_password 2) the login scripts are RE-USED for another site 3) In the test fase I use the SAME database table values and copy these in phpmyadmin to a new table is it possible there is some kind of copy security or whatever in the encrypted original table values? I presume this because there is no password_verify match. It could be I'm overlooking something, but the password_verify($form_pw, $database_pw) procedure, does not need encryption BEFORE $form_pw is read? The only conclusion then is:
  15. Sorry people here I have asked this before, so its a bit embarassing to me. But .... I have the following question. Its about using a function inside an if condition. The thing is that when I make a function with 2 returns in this case $data and $alternative I receive them both back. I ask this for grasping how a function acts inside an if condition. So my question is: how does the php engine ‘reason’? Is the outcome of the return ONLY POSSIBLE if you return 1 value inside an if condition; so either true or false ? Example:
×
×
  • Create New...