January 7, 201115 yr hi evryone this is my first post (please be kind and understanding with me) im makeing a single web page for a friend of mine and im just not sure how to go about it. the page idealy should have an interactive feel to it smothing like what im going to try and layout for you below. Page loads. Welcome to (websitenamehere) What is your name (user input goes here) Thank you (user input is printed here) (some text is scroling accros the screen like a typwrighter) thats the basic content of the page, with that said it needs to grab the attention of the user, im just not sure how to do that my problem is that i only know basic (verry basic) html and that it, i was hopeing that you could give me an idea how to acomplish the task at hand. Thanks for reading Purity
January 7, 201115 yr Author Hi! I'm new here myself. It's impossible for you to achieve what you're looking for with HTML alone. HTML is used for structuring web pages, not interactivity. You'll need to look at something like JavaScript or PHP to do that, I'm afraid. thanks for the help samllerz, how would i achieve my task using html and JavaScript?
January 7, 201115 yr You'd need to use some script, but I would suggest against having pop up login boxes, drives users mad. You could use javascript or php to name just two options, it its javascript users can disable your script. I see Smallerz beat me too it. Edited January 7, 201115 yr by WBC
January 7, 201115 yr Author You'd need to use some script, but I would suggest against having pop up login boxes, drives users mad. You could use javascript or php to name just two options, it its javascript users can disable your script. I see Smallerz beat me too it. yea pop up boxes usualy drive me insane so i wont be useing them in my project. which language would give me a more flexible aproach to this project Edited January 8, 201115 yr by purity
January 8, 201115 yr which language PHP or JavaScript would give me the best result? as said before javascript can be turned off by the user, so php would be the better option Edited January 8, 201115 yr by pat24
January 8, 201115 yr Author ok so php is the best option for the job where would be a good starting point for me?
January 8, 201115 yr You could try googling what you want and maybe come a cross a pre-made one or if you are after doing it yourself try w3schools
January 9, 201115 yr heres the basics of what you want in javascript (annoying pop-up box version): <html> <head> <script type="text/javascript"> function show_prompt() { var name=prompt("Please enter your name","name..."); if (name!=null && name!="") { document.write("Thank you " + name); } } </script> </head> <body> <input type="button" onclick="show_prompt()" value="Show prompt box" /> </body> </html> and for php you could do something like this: <html> <head> <?php if($_POST){ $username = $_POST['username']; } ?> </head> <body> <?php if($username != ""){ echo 'Thank you '.$username; } ?> <form action="urlOfThisPage" method="POST"> <h1>Please enter name</h1> <input type="text" name="username"/> <input type="submit"/> </form> </body> The example above will take the users input in the text field and send it too itself when submited. The php in the head of the document will check to see if this has happened, if it has it will store the user input in the variable '$username'. The php in the body of the document will check if there is any data in the variable and if there is it will print Thank you 'userInput'. Note: in order for php to run you need to have the pages extension as .php not .html... it also needs to be on a server with php installed Edited January 9, 201115 yr by frupence
Create an account or sign in to comment