ProSpartan Posted October 31, 2012 Share Posted October 31, 2012 Hello, This is my first time posting and as my first posting, it's going to be a tall order to fill. I've had a little experience in html programming and a substantial amount more in programming(VB, C#, C++, Java). I've come here because I need help from the experts in HTML programming. What the title, I hope, explains is that I would like to make a web page that a user can use to create a task via text box, importance level descending from Highly Important/Important/Can Wait, day and time assigned, and the submit button, then the web page adds it to a list which the user can view, as well as a check box, or something, that will select it and if the user desires, press a delete button, assuming the task is completed. The list is not to be user specific, because it's only going to be used between another person and myself. I'm pretty sure i'm going to need a database of some sort in MySQL or something, but I don't know how to do that. I don't expect someone to have all the info, which is fine. I can do the basic text box, radio buttons for importance, and submit button but that's about it. Beyond is where i need the help. Anyway, if you can help, that would be cool. Thanks! ProSpartan P.S. I added a base line .html file that contains the basic stuff. If anyone can help, you can use that for building onto it. Thanks again. Tasks to Complete.html Link to comment Share on other sites More sharing options...
niche Posted October 31, 2012 Share Posted October 31, 2012 Please give your form an action and post your php as far as you can get it. Link to comment Share on other sites More sharing options...
ProSpartan Posted October 31, 2012 Author Share Posted October 31, 2012 As far as my skills in html go, they don't cover actions nor php. Link to comment Share on other sites More sharing options...
ProSpartan Posted October 31, 2012 Author Share Posted October 31, 2012 Okay, from my understanding of using the action and the php from w3schools, i came up with this php file: Not sure though if I should use the $_GET or $_POST. tasks.php Link to comment Share on other sites More sharing options...
niche Posted October 31, 2012 Share Posted October 31, 2012 (edited) You're moving in the right direction. Please note that it's the $_POST array not the $_POSTS array. Consequently, that means you didn't test your script before posting it. Please test before posting from now on and let us know what errors you're getting (if any). Any way, you've chosen the $_POST array. What are you going to do with it? Edited October 31, 2012 by niche Link to comment Share on other sites More sharing options...
ProSpartan Posted October 31, 2012 Author Share Posted October 31, 2012 (edited) Going to want to display it, and down the line, save it to a database. Would i want another form that displays the information, as well as another php page that gets the info for the form? Or maybe assign it to a declaration, which according to my search is '$Example =" followed by the POST statments. I did try it, but even though i pressed the submit button, nothing happened. Even after the change from POSTS to POST. Edited October 31, 2012 by ProSpartan Link to comment Share on other sites More sharing options...
niche Posted October 31, 2012 Share Posted October 31, 2012 Then that's where you need to start. Comment-out your the code you have in tasks.php and put this simple code in it: <?phpecho "here";?> and run your form code. Did tasks.php display "here"? Link to comment Share on other sites More sharing options...
ProSpartan Posted October 31, 2012 Author Share Posted October 31, 2012 (edited) No, it did not display when i pressed the submit button. It may be some settings on IE, but i can not do anything about it. When i get home, i will try it and see if it works. I changed the beginning of each POST statement with $Task = <?php echo $_POST["task"]; ?> and so on with the others. Edited October 31, 2012 by ProSpartan Link to comment Share on other sites More sharing options...
niche Posted October 31, 2012 Share Posted October 31, 2012 Then the problem is probably in your html. Did you add the action to your form? Link to comment Share on other sites More sharing options...
ProSpartan Posted October 31, 2012 Author Share Posted October 31, 2012 Yes, it is <form action="tasks.php" method="post"> Link to comment Share on other sites More sharing options...
niche Posted November 1, 2012 Share Posted November 1, 2012 Then post your html and your php Link to comment Share on other sites More sharing options...
ProSpartan Posted November 1, 2012 Author Share Posted November 1, 2012 I tested before i assigned and after. tasks.php Tasks_to_Complete.html Link to comment Share on other sites More sharing options...
thescientist Posted November 1, 2012 Share Posted November 1, 2012 more importantly, are you testing this on a webserver? Either installed locally using something WAMP or MAMP, or on a hosted server that supports it? Executing PHP requires more of your system then just what you would normally need to test HTML/CSS. Link to comment Share on other sites More sharing options...
ProSpartan Posted November 1, 2012 Author Share Posted November 1, 2012 more importantly, are you testing this on a webserver? Either installed locally using something WAMP or MAMP, or on a hosted server that supports it? Executing PHP requires more of your system then just what you would normally need to test HTML/CSS.Well, that could be the problem then, haha. I'm doing it on the localhost, nothing else. Link to comment Share on other sites More sharing options...
niche Posted November 2, 2012 Share Posted November 2, 2012 Does your localhost have php? Link to comment Share on other sites More sharing options...
ProSpartan Posted November 2, 2012 Author Share Posted November 2, 2012 I don't know. I't a standard install, as far as i know, and have no access to download things. although, i may be able to use a stand-alone computer and have someone else download it. Link to comment Share on other sites More sharing options...
niche Posted November 2, 2012 Share Posted November 2, 2012 Per post #13, install a WAMP (it's free) and get back to us http://www.wampserver.com/en/ Or, decide if you have php installed on your localhost. If not, install the WAMP and report back. Link to comment Share on other sites More sharing options...
ProSpartan Posted November 2, 2012 Author Share Posted November 2, 2012 I'm installing a RedHat 6 to us for php support, also for a cert in RedHat Sys Admin. I'll let ya'll know when I test to see if it works. Link to comment Share on other sites More sharing options...
ProSpartan Posted November 2, 2012 Author Share Posted November 2, 2012 (edited) Okay, so i am now running a php compatable computer. It does not print simple messages like <?php echo "Hello World!"; ?>, nor is it accepting miltiple assignments via $Example = .... , atleast not in gedit, but in Emacs, it does. Edited November 2, 2012 by ProSpartan Link to comment Share on other sites More sharing options...
ProSpartan Posted November 2, 2012 Author Share Posted November 2, 2012 Okay, i figured out that i don't need to reapply the <?php ?> for the POST statement, although an echo does not work with echo $Task; Link to comment Share on other sites More sharing options...
niche Posted November 2, 2012 Share Posted November 2, 2012 Please post the code you actually tested. Link to comment Share on other sites More sharing options...
ProSpartan Posted November 2, 2012 Author Share Posted November 2, 2012 Here is the php: <html><body><?php$Task = echo $_POST["task"];$Importance = echo $_POST["importance"];$Date = echo $_POST["date"];$Time = echo $_POST["time"];echo $Task;?></body></html> <html><head><title>Tasks to Complete</title></head><body><table border="1" width="100%" height="100%"><tr width="100%" height="10%"> <td colspan="2" height="10%"> <h2 align="center">Welcome to the Task List</h2> </td></tr><tr width="100%" height="90%"> <td width="50%" height="100%"> <form action="tasks.php" method="post"> <fieldset> <legend>Enter New Task</legend> <textarea rows="15" cols="50" name="task"></textarea> </br> </br> <input type="radio" name="importance" id="highly important">Highly Important</input> </br> <input type="radio" name="importance" id="important">Important</input> </br> <input type="radio" name="importance" id="can wait">Can Wait</input> </br> <p>Date Assigned <input type="text" name="date" id="date"></input></p> <p>Time Assigned <input type="text" name="time" id="time"></input></p> <input type="submit" id="submit" value="Submit Task"></input> </fieldset> </form> </td> <td width="50%" height="100%"> <iframe width="100%" height="100%" name="tasksviewr"> </iframe> </td></tr></table></body></html> Link to comment Share on other sites More sharing options...
thescientist Posted November 2, 2012 Share Posted November 2, 2012 take the echo out of your assignment statements, i.e. $Task = $_POST['task'];echo $Task; Link to comment Share on other sites More sharing options...
niche Posted November 3, 2012 Share Posted November 3, 2012 Assuming your scripts work, what are you going to do with your form data? Link to comment Share on other sites More sharing options...
ProSpartan Posted November 5, 2012 Author Share Posted November 5, 2012 take the echo out of your assignment statements, i.e.$Task = $_POST['task'];echo $Task; Okay, i took out the echo's, but it did not display anything when it when to the next screen, opening tasks.php. Assuming your scripts work, what are you going to do with your form data? I'm going to want to save it in a database. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now