Jump to content

Gabrielphp

Members
  • Content Count

    32
  • Joined

  • Last visited

Everything posted by Gabrielphp

  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 (H
  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.
  16. Yes. <?= ?> is a shortcut for <?php echo ""; ?> All of the above will translate as follows: <?php echo ++$a; ?> <?php echo ++$b; ?> <?php echo $private_id; ?> <?php echo session_id(); ?>
  17. In your users table you should have a column called group or rang or whatever you want your admin to be named. After that you simply create a table called groups with your different ranks and functions, when you done that, you make sure that the id of the rang in the groups table match the id the user has in it's column. For example you make 2 different groups, Super User, and Moderator. Super User has the id of 1 and can access all administrative pages, in that case you make an IF condition between the Super User record's ID in the table and the user's ID in the column. The script will
  18. Gabrielphp

    Sending mail

    You could just use XAMPP as your default webbrowser, xampp comes with pre-installed mysql, php and apache server, and it also have a firezilla ftp server and the mercury mail server. Just look up on it.
  19. You can look up for bootstrap landing pages and then you can work yourself up from there. Bootstrap it's easy to customize and you can always create your own pages as you don't need to create the components yourself, just paste the code, make a css file to have your own design, put some js and jquery in it for effects and there it is. And you can always use php and ajax to make it more interactive with users.
  20. It won't redirect you mainly because header cannot be used like that. Instead of using header just echo a javascript script: echo '<script>window.location.href="url";</script>';
  21. First of all you don't need to save the all URL in the database, you just need to save the path like if your view_video.php (example) is in the home directory, where index and other pages are and your video is in uploaded/$name, then you need to insert into the DB only uploaded/$name. If your php page is in other folder like a folder named "videos" and there is your page but then you have your video in the "uploaded" folder outside the videos folder then the path will be ../uploaded/$name and so on. And to stop uploading the URL in the DB you need to check whether the video has done uploa
  22. It is so much much easier to do it in PDO, why don't you use it ? And it is even more secure. dbconnection: try { $username = "db_username"; $password = "db_password"; $db = new PDO("mysql:host=localhost;dbname=your_dbname", $username, $password); $db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); echo "Connected !"; } catch (PDOException $e) { echo $e->getMessage(); } then your script to insert those values: try { $sql = "UPDATE users SET Username=:username, Email=:email, EmployeeID=:empid, Designation=:design, Password=:password WHERE Id = :id";
  23. Upon refreshing, the video is still uploaded to database ? Not the folder, because i might be thinking that it displays you the page because in database there is a video saved with an url but on your host in the videos folder there is no video with the url from db, that's mostly why you have that error.
  24. <form method="post" action="/post.php"> -> this is wrong. <form method="post" action="post.php"> -> this is right ( if the post.php is in the same directory as the page you are calling on. <form method="post" action="../post.php"> -> goes with a directory up.
  25. I need to know what column do you have in your DB where the value is 1 and where you set the $_SESSION['id'] variable after login, after that i can help you further.
×
×
  • Create New...