Jump to content

TrillionBuks

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TrillionBuks's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, everyone. I am brand new to PHP and I'm trying to teach myself using some books and web tutorials. I downloaded Apache 2.28 and PHP5. I tried installing but Im not sure if I was doing it correct. I removed both programs but still have the the installers on my Windows XP machine. Can someone please guide me in installing both and configuring them so I can start practicing PHP. ANy info is appreciated. Thanks!
  2. I installed WAMP and it gives me an error when I try to put it online. "the service has not been started". I start all services but nothing happens. I am trying to test the following code. Can anyone help or review my code for errors? Thanks. <?php if (isset($_POST['first_name']) && isset($_POST['last_name']) && isset($_POST['email']) && isset($_POST['phone']) && !empty($_POST['first_name']) &7 !empty($_POST['last_name']) && !empty($_POST['email']) && !empty($_POST['phone')) { $errors = array(); if (!ereg("^[^@ ]+@[^@ ]+\.[^@ ]+$", $_POST['email']) { $errors[] = "Invalid E-Mail Address!"; } if (!ereg("((\(\d{3}\)?)|(\d{3}))([\s-./]?)(\d{3})([\s-./]?)(\d{4})", $_POST['phone']) { $errors[] = "Invalid Phone Number!"; } if (!empty($errors)) { foreach ($errors as $error) { echo $error . "<br />"; } } else { echo "First Name: " . $_POST['first_name'] . "<br />"; echo "Last Name: " . $_POST['last_name'] . "<br />"; echo "E-Mail : " . $_POST['email'] . "<br />"; echo "Phone: " . $_POST['phone'] . "<br />"; } } ?>
  3. Iam creating an form with four fields and I want to see how it looks when executed. In addition I wasnt to test the email and phone number verification.
  4. I am brand new to php. How do I test the code that I have written? Any advice is appreciated.Thank you.
  5. The following is a form I created that meets the specifications of the assignment. Now that I have the form how do I add the needed PHP code so that I meet the requirements of the assignment. Thanks again. <form method="post" action="http://www.emailmeform.com/fid.php?formid=59553" enctype="multipart/form-data"> <INPUT TYPE=hidden NAME=FCode VALUE="nbb4xam9"> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF"> <tr> <td> <font face="Verdana" size="2" color="#000000"></font> <div style="" id="mainmsg"> </div> </td> </tr> </table> <br> <table cellpadding="2" cellspacing="0" border="0" bgcolor="#FFFFFF"> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">First Name</font></td> <td> <input type="text" name="FieldData0" value="" maxlength="100" size="30"> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Last Name</font></td> <td> <input type="text" name="FieldData1" value="" maxlength="100" size="30"> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Email</font></td> <td> <input type="text" name="FieldData2" value="" maxlength="100" size="30"><div style="position:absolute; top:343px; right:1582px;"><b>Tip: How to delete search history</b><br>Tutorial on how to <a href="http://www.amicutilities.com/privacy-guard/?v=deletehistory">delete search history</a> automated without leaving any traces that make the files recoverable</div> </td> </tr> <tr valign="top"> <td nowrap><font face="Verdana" size="2" color="#000000">Telephone</font></td> <td> <input type="text" name="FieldData3" value="" maxlength="100" size="30"> </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td> </td> <td align="right"> <input type="text" name="hida2" value="" maxlength="100" size="3" style="display : none;"> <input type="submit" class="btn" value="Send email" name="Submit"></td> </tr> <tr> <td colspan=2 align="center"> <br> </td> </tr> </table> </form>
  6. I take it that my HTML form is incorrect. I am trying first to create the form, then add the PHP to it. Is this the wrong aproach? Is there any help other than a automated script generator that you can offer?
  7. First of...thanks Matt for the detailed breakdown. I started writing my first HTML form using the website that was previously given. I have some questions about the following inital attempt at the form: <form method="post" action="mailto:youremail@email.com"> First Name: <input type="text" size="10" maxlength="40" name="f_name"> <br /> Last Name: <input type="text" size="10" maxlength="40" name="l_name"> <br /> Email: <input type="text" size="10" maxlength="40" name="email"> <br /> <input type="submit" value="Send"> </form> As the code is written will it display boxes labled First Name, Last Name and email? What does the size refer to? Is maxlength the length of characters it allocates? Was I correct in changing name= f_name, name= l_name and name=email? I want to add a box for a telephone number. DO I need to change the input type? If so to what? should I drop maxlength to 10? Thanks.
  8. I appreciate all the information. A quick question about "validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;" I have never seen code like this before and was wondering if you can explain to me what is going on. I am assuming that it is checking to see if the email string contains valid characters followed by an '@' some more valid characters (a-z) then a period and finally a valid extension. Adain this my assumption and would appreciate a detailed breakdown of it for my knowledge. Thanks again!
  9. Upon my initial research I see that PHP makes call to headers and executes the data contained on the page. Is that a correct understanding of the following snippet of code? if (!isset($_REQUEST['email'])) { header( "Location: http://www.example.com/feedback.html" ); //verifies if variable has been defined, calls header with some sort of feedback } elseif (empty($email) || empty($message)) { header( "Location: http://www.example.com/error.html" ); //if either field is empty call the error.html header and execute instructions within } else { mail( "yourname@example.com", "Feedback Form Results", $message, "From: $email" ); header( "Location: http://www.example.com/thankyou.html" ); //everything checks and execute confirmation from thankyou.html If so, do I need to create dummy headers and instructions to have my code call from them? Do you think I can just make up pertinent names without creating the file to back up the call? How can I test my program in a windows environment? You mentioned notepad with a php plugin; Will that enable me to test my code for syntax errors and logical mistakes? Thanks again!
  10. Good afternoon everyone. I am new to PHP and as a consequence new to this site. I am applying for an internship with a web company and they gave me a sample assignment to complete. They know I do not have any experience with PHP and said they want me to be resourceful and seek out a way of completing the assignment. In addition to the assignment I would like to practice at home in a windows environment. Do you have any recommendations for a free download? The following are the parameters of the assignment I was given: Develop a form that gathers and emails all the info upon submitting it. Form structure: first_name, last_name, email, phone all fields are required validate the email and phone structure Any information is appreciated. Thank you in advance!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.