Jump to content

Gabrielphp

Members
  • Posts

    32
  • Joined

  • Last visited

Previous Fields

  • Languages
    PHP, Javascript, jQuery, HTML, CSS, MySQL

Profile Information

  • Gender
    Male
  • Interests
    Web development

Gabrielphp's Achievements

Newbie

Newbie (1/7)

10

Reputation

  1. You need to have a name attribute in your input aswell, id doesn't work with Post just names. Otherwise you don't send any value to php logic to work with. <input id="FavMonster" name="FavMonster" type = "text" value = "" />
  2. You can use a php function called is_numeric(). if(is_numeric($var)) { //do stuff } else { //do other stuff } Hope this is what you want.
  3. Gabrielphp

    mail() max loop

    I think you will find this post on stackoverflow interesting. https://stackoverflow.com/questions/1543153/is-there-a-limit-when-using-php-mail-function
  4. It doesn't have a plain reading. You use that question mark because it is a query string. From https://www.freeformatter.com/url-parser-query-string-splitter.html What's the 'query string' in a URL? The query contains extra information that is usually in the key-pair format. Each pair is usually separated by an ampersand & character. It follows the ? character. Examples: http://www.foo.bar/image.jpg?height=150&width=100 https://www.secured.com:443/resource.html?id=6e8bc430-9c3a-11d9-9669-0800200c9a66#some-heade
  5. So what's your idea of coding a comment section? Before we can help you and eventually give you some code examples you need to show us some code too, we can't just give you the code without you doing something first because this way you won't learn to do it by yourself.
  6. If you are doing such coding use the : form and not { }, it will be much easier to understand the code when you mix them. <?php if(condition): ?> Html here <?php else: ?> Html here <?php endif; ?>
  7. So this is my answer for your problem: index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Name Control</title> </head> <body> <form method="post" action="namecontrol.php" > <input type="text" name="name" placeholder="Insert your name ..." /><br/> <input type="text" name="lastname" placeholder="Insert your last name ..." /><br/> <input type="submit" value="Submit" name="submit" /><br/> </form> </body> </html> namecontrol.php (HTML LIST) <?php if($_SERVER['REQUEST_METHOD'] == "POST") { if(isset($_POST['submit'])) { $name = $_POST['name']; $lastName = $_POST['lastname']; if(empty($name) || empty($lastName)) { echo "Please complete all fields to proceed !"; } else { echo "<ul>"; echo "<li>name: " . $name . " </li>"; echo "<li>lastname: " . $lastName . "</li>"; echo "</ul>"; } } } ?> namecontrol.php (ARRAY) <?php if($_SERVER['REQUEST_METHOD'] == "POST") { if(isset($_POST['submit'])) { $name = $_POST['name']; $lastName = $_POST['lastname']; if(empty($name) || empty($lastName)) { echo "Please complete all fields to proceed !"; } else { $array = array("name" => $name, "lastname" => $lastName); print_r($array); } } } ?>
  8. I think you're missing something to tell us. I've recreated the same environment as yours and also added an echo "Ok!"; in the c.php and at me it works fine, exactly the same settings as yours. As i did it, i used Windows to do it, so it might aswell be the thing that you're using linux, and it might be possible that the paths don't work as are working in windows. Try putting the "../obj/c.php"; as path in the b.php althought you have it in the same directory and see if that works, if not then i don't know what should work as on my pc (windows) works just fine.
  9. What does it reffers to when it says has to see the data as a list? You mean like a html <ul><li> or an array() in php and echo that?
  10. It shouldn't let him log in as long as there is no other user with the same "Matricola" as in his SQL, i'm using fetchAll myself and i intentionally created another username with the same password as my other username and it won't log me in.
  11. What do you mean by encoding your php code? All i know is encoding charachters (UTF-8 etc) or json_encode(). What should your encoded code do?
  12. As long as my php knowledge goes is that you can't do it in pure php, you need some javascript aswell. Unfortunately i can't tell you diretly how is done cuz i never did something like that myself, but i found some tutorials that might help: http://subinsb.com/create-profile-picture-framer-web-app https://www.experts-exchange.com/articles/217/Framing-images-in-PHP.html Hope it helps.
  13. Try using fetchAll() instead of fetch().
  14. Ah, true, it has an or die statement. Sorry.
  15. In your code at the mysqli_connect() it misses this ";" it cannot work if you don't put it.
×
×
  • Create New...