ralphiedee Posted July 18, 2008 Share Posted July 18, 2008 Hello php gurus, I have a client that needs a form like the one in the url below. I design web sites but don't know.php The form needs to have the following fields where visitors can enter: their e mail address their comments only their comments are displayed. Please see the image. All of this in one script on one page, any help? http://www.mediafire.com/imageview.php?quickkey=2nthjm19hnd&thumb=4 I also need a second script for a separate page were visitors can register, log in and post. Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/ Share on other sites More sharing options...
MasterACE14 Posted July 19, 2008 Share Posted July 19, 2008 <?php if(isset($_POST['email']) && isset($_POST['comment'])) { if(!empty($_POST['email'])) { if( !empty($_POST['comment']) { // do stuff with your comment and e-mail here } else { die("Please type a comment."); } } else { die("Please type your e-mail."); } } else { echo <<<_FORM <form action="thispage.php" method="post"> E-mail <input type="text" name="email"> Comment <textarea name="comment"></textarea> </form> _FORM; } ?> try that. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-593924 Share on other sites More sharing options...
ralphiedee Posted July 19, 2008 Author Share Posted July 19, 2008 OK, copy the code in a page and title it whatever.php? What about the html code? rrr Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-593955 Share on other sites More sharing options...
DeanWhitehouse Posted July 19, 2008 Share Posted July 19, 2008 this is more HTML friendly <html> <head> </head> <body> <?php if(isset($_POST['email']) && isset($_POST['comment'])) { if(!empty($_POST['email'])) { if( !empty($_POST['comment']) { // do stuff with your comment and e-mail here } else { die("Please type a comment."); } } else { die("Please type your e-mail."); } } else { ?> <!-- HTML FORM --> <form action="thispage.php" method="post"> E-mail <input type="text" name="email"> Comment <textarea name="comment"></textarea> </form> <!-- HTML FORM --> <?php } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-593958 Share on other sites More sharing options...
ralphiedee Posted July 19, 2008 Author Share Posted July 19, 2008 Thx 4 the html version, a few things. How can I make the comment box appear as a bigger size? I realized client needs a log in and p word so comments can be made by members. I would need to create another page with a log in and password script and just put the link to the log in on top of the add email box? If you look at the image in the url provided I need an exact match. thx a million this is helping me big time! respect!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-593963 Share on other sites More sharing options...
DeanWhitehouse Posted July 19, 2008 Share Posted July 19, 2008 You will have to do the image your self, this is not the freelance section we are here to help not to do it all for you. For registration you will need to decide whether to have it db driven or not , and then make a script from there. <html> <head> </head> <body> <?php if(isset($_POST['login'])) { $username = "username"; $password = "password"; if($username == $_POST['password'] && $password == $_POST['password']) { $_SESSION['login'] = true; } else { echo "Wrong username or password"; } } if(isset($_SESSION['login']) == true) { if(isset($_POST['email']) && isset($_POST['comment'])) { if(!empty($_POST['email'])) { if( !empty($_POST['comment']) { // do stuff with your comment and e-mail here } else { die("Please type a comment."); } } else { die("Please type your e-mail."); } } else { ?> <!-- HTML FORM --> <form action="thispage.php" method="post"> E-mail <input type="text" name="email"> Comment <textarea name="comment" cols="50" rows="10"></textarea> </form> <!-- HTML FORM --> <?php } } else { ?> Please Login <form method="post" action=""> <input type="text" name="uname"/> <input type="password" name="password"/> <input type="submit" name="login" value="Log In"/> </form> <?php } ?> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-593968 Share on other sites More sharing options...
DeanWhitehouse Posted July 19, 2008 Share Posted July 19, 2008 solved? Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-594293 Share on other sites More sharing options...
ralphiedee Posted July 19, 2008 Author Share Posted July 19, 2008 Almost, I need to speak with the client to explain this. The log in and p word script would have to be database driven can a .php database do this? If so I know the webhosting she has allows for .php its just a matter of getting the script together, I will not have need programming like don't allow bad words, or different levels of membership. Just a straight script like in the url http://www.mediafire.com/imageview.php?quickkey=2nthjm19hnd&thumb=4 thanks again as it makes me think if I should give someone else the programming and stick with what I know. Everybody has a skill mine isn't .php I'm too busy in PShop, Flash, Xml and others Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-594294 Share on other sites More sharing options...
ralphiedee Posted July 19, 2008 Author Share Posted July 19, 2008 I have part of the script here. <form action="http://yoursite.com/wp-comments-post.php" method="post" id="commentform" name="commentform"> <div id="comment-loggedin" width="470px" style="display: none;"> <h3 id="respond" style="color:#CC0066;">Leave your comment</h3> <p style="float: left;"><span style="color:#CC0066;font-weight:bold;">Welcome back, <span id="posse_nickname_slot"></span>!</span></p> <p style="float: right;"><span style="color:#CC0066;font-weight:bold;"> <span id="posse_id_slot"></span> or <a style="text-decoration: underline;" href="" onclick="javascript: logMeOut();return false;">logout</a></span></p> <p id="posse_emptyavatar_note" style="font-size:9px;font-style:italic;padding-left:10px;color:#CC0066;display:none;clear:both;"></p> <p style="clear:both;font-size:9px;font-style:italic;padding-left:10px;color:#CC0066">Note: Your comment may take a few minutes to appear.</p> </div> <div id="comment-login" width="470px" style="display: block;"> <h3 id="respond" style="color:#CC0066;">Leave your comment, <a style="color:#CC0066;text-decoration:underline;" href="http://yoursite.com:8888/register/?came_from=http://yoursite.com/2008-07-18" target="_blank">create a nickname and avatar</a> or <a style="color:#CC0066;text-decoration:underline;" href="http://yoursite.com:8888/login/?came_from=http://yoursite.com/2008-07-18">login</a></h3> <p style="font-size:9px;font-style:italic;padding-left:10px;color:#CC0066">Note: Only registered commenters can have names longer than five letters. Your comment may take a few minutes to appear.</p> <p> <input type="text" value="" id="author" name="author" size="22" tabindex="1" /> <label for="author"><span style="color:#CC0066;font-weight:bold;">name *</span></label></p> <p> <input type="text" name="email" id="email" size="22" tabindex="2" value="" /> <label for="email"><span style="color:#CC0066;font-weight:bold;">email * (will not show on comment)</span></label> </p> </div> <p><textarea name="comment" id="comment" cols="100%" rows="6" tabindex="4"></textarea></p> <p><input name="submit" type="submit" id="submit" tabindex="5" value="submit comment" /> <input type="hidden" name="comment_post_ID" value="25416" /> </p> <iframe id='logout-frame' style="display: none;"></iframe> </form> Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-594309 Share on other sites More sharing options...
DeanWhitehouse Posted July 19, 2008 Share Posted July 19, 2008 .php database? no such thing(correct me if im wrong) ,also please at least attempt to make the script and ask for help on errors, if you want the script made for you . go to the freelance section. Quote Link to comment https://forums.phpfreaks.com/topic/115531-need-a-php-script-to-generate/#findComment-594329 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.