[SOLVED] first attempt at writting php form from scratch

This is a discussion on "[SOLVED] first attempt at writting php form from scratch" within the PHP Forum section. This forum, and the thread "[SOLVED] first attempt at writting php form from scratch are both part of the Program Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > PHP Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Nov 5th, 2007, 20:19
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] first attempt at writting php form from scratch

I have tried my hand at writing my first form to php mailer. It worked fine until messed with the strings that define the $variables. Apparently I have a few syntax problems. Any help would be greatly appreciated. Thanks so much in advance!

here is the form...
Code: Select all
    <div id="form_container">
        <form method="post" action="request.php" target="success">
                    <div class="form_description">
            <h2>Request Paul to Speak at Your Event</h2>
        </div>                        
            <ul >
            
                    <li id="li_1" >

        <label class="description" for="element_1">Date of Event </label>
        <span>
            <input id="element_1_1" name="month" class="element text" size="2" maxlength="2" value="" type="text"> /
            <label for="element_1_1">MM</label>
        </span>
        <span>
            <input id="element_1_2" name="day" class="element text" size="2" maxlength="2" value="" type="text"> /
            <label for="element_1_2">DD</label>
        </span>
        <span>
             <input id="element_1_3" name="year" class="element text" size="4" maxlength="4" value="" type="text">
            <label for="element_1_3">YYYY</label>
        </span>
    
        <span id="calendar_1">
            <img id="cal_img_1" class="datepicker" src="graphics/calendar.gif" alt="Pick a date.">        </span>
        <script type="text/javascript">
            Calendar.setup({
            inputField     : "element_1_3",
            baseField    : "element_1",
            displayArea  : "calendar_1",
            button         : "cal_img_1",
            ifFormat     : "%B %e, %Y",
            onSelect     : selectDate
            });
        </script>
        </li>        <li id="li_2" >
        <label class="description" for="element_2">Name of the Event </label>
        <div>
            <input id="element_2" name="event_name" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_8" >
        <label class="description" for="element_8">Which book would you like for Paul to speak on? </label>
        <span>

            <input id="element_8_1" name="book" class="element radio" type="radio" value="Dynamic Dads: How To Be A Hero To Your Kids" />
            <label class="choice" for="element_8_1">Dynamic Dads: How To Be A Hero To Your Kids</label>
            
            <input id="element_8_2" name="book" class="element radio" type="radio" value="Congratulations, You've Got Tweens!" />
            <label class="choice" for="element_8_2">Congratulations, You've Got Tweens! - Preparing Your Child for Adolescence</label>
        </span> 
        </li>        
        <li id="li_3" >
        <label class="description" for="element_3">Please provide us with the details of your event. </label>
        <div>

            <textarea id="element_3" name="details" class="element textarea medium"></textarea> 
        </div> 
        </li>        <li id="li_4" >
        <label class="description" for="element_4">Contact Name <span id="required_4" class="required">*</span></label>
        <span>
            <input id="element_4_1" name= "fname" class="element text" maxlength="255" size="8" value=""/>
            <label>First</label>
        </span>
        <span>
            <input id="element_4_2" name= "lname" class="element text" maxlength="255" size="14" value=""/>
            <label>Last</label>
        </span> 
        </li>        <li id="li_5" >
        <label class="description" for="element_5">Contact Phone </label>
        <span>

            <input id="element_5_1" name="area" class="element text" size="3" maxlength="3" value="" type="text"> -
            <label for="element_5_1">(###)</label>
        </span>
        <span>
            <input id="element_5_2" name="prefix" class="element text" size="3" maxlength="3" value="" type="text"> -
            <label for="element_5_2">###</label>
        </span>
        <span>

             <input id="element_5_3" name="four" class="element text" size="4" maxlength="4" value="" type="text">
            <label for="element_5_3">####</label>
        </span>
         
        </li>        <li id="li_6" >
        <label class="description" for="element_6">Contact Email <span id="required_6" class="required">*</span></label>
        <div>
            <input id="element_6" name="contacte" class="element text medium" type="text" maxlength="255" value=""/> 
        </div> 
        </li>        <li id="li_7" >

        <label class="description" for="element_7">Contact Address </label>
        
        <div>
            <input id="element_7_1" name="add1" class="element text large" value="" type="text">
            <label for="element_7_1">Street Address</label>
        </div>
    
        <div>
            <input id="element_7_2" name="add2" class="element text large" value="" type="text">
            <label for="element_7_2">Address Line 2</label>
        </div>
    
        <div class="left">
            <input id="element_7_3" name="city" class="element text medium" value="" type="text">
            <label for="element_7_3">City</label>
        </div>
    
        <div class="right">
            <input id="element_7_4" name="state" class="element text medium" value="" type="text">
            <label for="element_7_4">State / Province</label>
        </div>
    
        <div class="left">
            <input id="element_7_5" name="zip" class="element text medium" maxlength="15" value="" type="text">
            <label for="element_7_5">Postal / Zip Code</label>
        </div>
    
        <div class="right">
            <select class="element select medium" id="element_7_6" name="country"> 
            <option value="Afghanistan" >Afghanistan</option>
<option value="Albania" >Albania</option>
<option value="Algeria" >Algeria</option>
<option value="Andorra" >Andorra</option>
<option value="Antigua and Barbuda" >Antigua and Barbuda</option>
<option value="Argentina" >Argentina</option>
<option value="Armenia" >Armenia</option>
<option value="Australia" >Australia</option>
<option value="Austria" >Austria</option>
<option value="Azerbaijan" >Azerbaijan</option>

<option value="Bahamas" >Bahamas</option>
<option value="Bahrain" >Bahrain</option>
<option value="Bangladesh" >Bangladesh</option>
<option value="Barbados" >Barbados</option>
<option value="Belarus" >Belarus</option>
<option value="Belgium" >Belgium</option>
<option value="Belize" >Belize</option>
<option value="Benin" >Benin</option>
<option value="Bhutan" >Bhutan</option>

<option value="Bolivia" >Bolivia</option>
<option value="Bosnia and Herzegovina" >Bosnia and Herzegovina</option>
<option value="Botswana" >Botswana</option>
<option value="Brazil" >Brazil</option>
<option value="Brunei" >Brunei</option>
<option value="Bulgaria" >Bulgaria</option>
<option value="Burkina Faso" >Burkina Faso</option>
<option value="Burundi" >Burundi</option>
<option value="Cambodia" >Cambodia</option>

<option value="Cameroon" >Cameroon</option>
<option value="Canada" >Canada</option>
<option value="Cape Verde" >Cape Verde</option>
<option value="Central African Republic" >Central African Republic</option>
<option value="Chad" >Chad</option>
<option value="Chile" >Chile</option>
<option value="China" >China</option>
<option value="Colombia" >Colombia</option>
<option value="Comoros" >Comoros</option>

<option value="Congo" >Congo</option>
<option value="Costa Rica" >Costa Rica</option>
<option value="Côte d'Ivoire" >Côte d'Ivoire</option>
<option value="Croatia" >Croatia</option>
<option value="Cuba" >Cuba</option>
<option value="Cyprus" >Cyprus</option>
<option value="Czech Republic" >Czech Republic</option>
<option value="Denmark" >Denmark</option>
<option value="Djibouti" >Djibouti</option>

<option value="Dominica" >Dominica</option>
<option value="Dominican Republic" >Dominican Republic</option>
<option value="East Timor" >East Timor</option>
<option value="Ecuador" >Ecuador</option>
<option value="Egypt" >Egypt</option>
<option value="El Salvador" >El Salvador</option>
<option value="Equatorial Guinea" >Equatorial Guinea</option>
<option value="Eritrea" >Eritrea</option>
<option value="Estonia" >Estonia</option>

<option value="Ethiopia" >Ethiopia</option>
<option value="Fiji" >Fiji</option>
<option value="Finland" >Finland</option>
<option value="France" >France</option>
<option value="Gabon" >Gabon</option>
<option value="Gambia" >Gambia</option>
<option value="Georgia" >Georgia</option>
<option value="Germany" >Germany</option>
<option value="Ghana" >Ghana</option>

<option value="Greece" >Greece</option>
<option value="Grenada" >Grenada</option>
<option value="Guatemala" >Guatemala</option>
<option value="Guinea" >Guinea</option>
<option value="Guinea-Bissau" >Guinea-Bissau</option>
<option value="Guyana" >Guyana</option>
<option value="Haiti" >Haiti</option>
<option value="Honduras" >Honduras</option>
<option value="Hong Kong" >Hong Kong</option>

<option value="Hungary" >Hungary</option>
<option value="Iceland" >Iceland</option>
<option value="India" >India</option>
<option value="Indonesia" >Indonesia</option>
<option value="Iran" >Iran</option>
<option value="Iraq" >Iraq</option>
<option value="Ireland" >Ireland</option>
<option value="Israel" >Israel</option>
<option value="Italy" >Italy</option>

<option value="Jamaica" >Jamaica</option>
<option value="Japan" >Japan</option>
<option value="Jordan" >Jordan</option>
<option value="Kazakhstan" >Kazakhstan</option>
<option value="Kenya" >Kenya</option>
<option value="Kiribati" >Kiribati</option>
<option value="North Korea" >North Korea</option>
<option value="South Korea" >South Korea</option>
<option value="Kuwait" >Kuwait</option>

<option value="Kyrgyzstan" >Kyrgyzstan</option>
<option value="Laos" >Laos</option>
<option value="Latvia" >Latvia</option>
<option value="Lebanon" >Lebanon</option>
<option value="Lesotho" >Lesotho</option>
<option value="Liberia" >Liberia</option>
<option value="Libya" >Libya</option>
<option value="Liechtenstein" >Liechtenstein</option>
<option value="Lithuania" >Lithuania</option>

<option value="Luxembourg" >Luxembourg</option>
<option value="Macedonia" >Macedonia</option>
<option value="Madagascar" >Madagascar</option>
<option value="Malawi" >Malawi</option>
<option value="Malaysia" >Malaysia</option>
<option value="Maldives" >Maldives</option>
<option value="Mali" >Mali</option>
<option value="Malta" >Malta</option>
<option value="Marshall Islands" >Marshall Islands</option>

<option value="Mauritania" >Mauritania</option>
<option value="Mauritius" >Mauritius</option>
<option value="Mexico" >Mexico</option>
<option value="Micronesia" >Micronesia</option>
<option value="Moldova" >Moldova</option>
<option value="Monaco" >Monaco</option>
<option value="Mongolia" >Mongolia</option>
<option value="Montenegro" >Montenegro</option>
<option value="Morocco" >Morocco</option>

<option value="Mozambique" >Mozambique</option>
<option value="Myanmar" >Myanmar</option>
<option value="Namibia" >Namibia</option>
<option value="Nauru" >Nauru</option>
<option value="Nepal" >Nepal</option>
<option value="Netherlands" >Netherlands</option>
<option value="New Zealand" >New Zealand</option>
<option value="Nicaragua" >Nicaragua</option>
<option value="Niger" >Niger</option>

<option value="Nigeria" >Nigeria</option>
<option value="Norway" >Norway</option>
<option value="Oman" >Oman</option>
<option value="Pakistan" >Pakistan</option>
<option value="Palau" >Palau</option>
<option value="Panama" >Panama</option>
<option value="Papua New Guinea" >Papua New Guinea</option>
<option value="Paraguay" >Paraguay</option>
<option value="Peru" >Peru</option>

<option value="Philippines" >Philippines</option>
<option value="Poland" >Poland</option>
<option value="Portugal" >Portugal</option>
<option value="Puerto Rico" >Puerto Rico</option>
<option value="Qatar" >Qatar</option>
<option value="Romania" >Romania</option>
<option value="Russia" >Russia</option>
<option value="Rwanda" >Rwanda</option>
<option value="Saint Kitts and Nevis" >Saint Kitts and Nevis</option>

<option value="Saint Lucia" >Saint Lucia</option>
<option value="Saint Vincent and the Grenadines" >Saint Vincent and the Grenadines</option>
<option value="Samoa" >Samoa</option>
<option value="San Marino" >San Marino</option>
<option value="Sao Tome and Principe" >Sao Tome and Principe</option>
<option value="Saudi Arabia" >Saudi Arabia</option>
<option value="Senegal" >Senegal</option>
<option value="Serbia and Montenegro" >Serbia and Montenegro</option>
<option value="Seychelles" >Seychelles</option>

<option value="Sierra Leone" >Sierra Leone</option>
<option value="Singapore" >Singapore</option>
<option value="Slovakia" >Slovakia</option>
<option value="Slovenia" >Slovenia</option>
<option value="Solomon Islands" >Solomon Islands</option>
<option value="Somalia" >Somalia</option>
<option value="South Africa" >South Africa</option>
<option value="Spain" >Spain</option>
<option value="Sri Lanka" >Sri Lanka</option>

<option value="Sudan" >Sudan</option>
<option value="Suriname" >Suriname</option>
<option value="Swaziland" >Swaziland</option>
<option value="Sweden" >Sweden</option>
<option value="Switzerland" >Switzerland</option>
<option value="Syria" >Syria</option>
<option value="Taiwan" >Taiwan</option>
<option value="Tajikistan" >Tajikistan</option>

<option value="Tanzania" >Tanzania</option>
<option value="Thailand" >Thailand</option>
<option value="Togo" >Togo</option>
<option value="Tonga" >Tonga</option>
<option value="Trinidad and Tobago" >Trinidad and Tobago</option>
<option value="Tunisia" >Tunisia</option>
<option value="Turkey" >Turkey</option>
<option value="Turkmenistan" >Turkmenistan</option>
<option value="Tuvalu" >Tuvalu</option>

<option value="Uganda" >Uganda</option>
<option value="Ukraine" >Ukraine</option>
<option value="United Arab Emirates" >United Arab Emirates</option>
<option value="United Kingdom" >United Kingdom</option>
<option value="United States" selected="selected">United States</option>
<option value="Uruguay" >Uruguay</option>
<option value="Uzbekistan" >Uzbekistan</option>
<option value="Vanuatu" >Vanuatu</option>
<option value="Vatican City" >Vatican City</option>

<option value="Venezuela" >Venezuela</option>
<option value="Vietnam" >Vietnam</option>
<option value="Yemen" >Yemen</option>
<option value="Zambia" >Zambia</option>
<option value="Zimbabwe" >Zimbabwe</option>
            </select>
        <label for="element_7_6">Country</label>
    </div> 
        </li>

            
                    <li class="buttons">
                <input type="hidden" name="form_id" value="2" />
                
                <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
        </li>
            </ul>
        </form>    
    </div>
Here is the php the form is posting to...
Code: Select all
<?php
// All variables

//Contact Name *
$fname = $_POST["fname"];
$lname = $_POST["lname"];
    $contactn = $fname." ".$lname;
//Date of the Event *
$month = $_POST["month"];
$day = $_POST["day"];
$year = $_POST["year"];
    $date = $month."/".$day."/".$year;
//Event Name *
$event_name = $_POST["event_name"];
//Picked Book *
$book = $_POST["book"];
//Event Details *
$details = $_POST["details"];
//Contact Phone Number *
$area = $_POST["area"];
$prefix = $_POST["prefix"];
$four = $_POST["four"];
    $phone = $area."-".$prefix."-".$four;
//Contact's email *
$contacte = $_POST["contacte"];
//Address *
$add1 = $_POST["add1"];
$add2 = $_POST["add2"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$country = $_POST["country"];
    $address = $contactn\r . $add1\r . $add2\r . $city.", ".$state." ".$zip\r$country\r;

//the email
$to = "info@dynamicdads.com, $contacte";
$subject = "$contactn is requesting Paul to speak at their event";
// The message
$message = "$contactn is requesting Paul Pettit to speak at the following event.\r
Event Name: $event_name\r
Event Date: $date\r
Requested Book Topic: $book\r\n
Contact Name: $contactn\r
Phone: $phone\r
email: $contacte\r
Address:\r$address\r\n
Event Details: \r$details";
$headers = "From: $contacte" . "\r\n" .
    "Reply-To: $contacte" . "\r\n" .
    "X-Mailer: PHP/" . phpversion();

mail($to, $subject, $message, $headers);
?>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Nov 5th, 2007, 20:32
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: first attempt at writting php form from scratch

what errors do you receive?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Nov 5th, 2007, 20:39
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

No errors; really. I hit submit on the form and nothing happens. In version 1, I only tried to send the form elements by email, and that worked fine; the confirmation came up in the targeted iframe. Now, however, I have tried to stylize the output a bit. I wanted the email to look more like an email and not just a list on information. That's when it all went awry.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Nov 5th, 2007, 21:20
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: first attempt at writting php form from scratch

Uhh so what's not happening and what do you want to happen?
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Nov 5th, 2007, 21:28
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

After the fields are field out and someone presses "submit," I have an iframe to the side of the form that is supposed to say, "Success! Your email has been sent and Dynamic Dads will be in contact with you shortly." I think the browser is getting caught up in the php program I wrote and not progressing through because nothing is happening. The program is supposed to email the info to "info@dynamicdads.com" and back to the person who filled out the form as a receipt (labeled as $contacte) Nothing appears in iframe and no emails are sent or received.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Nov 5th, 2007, 21:33
alexgeek's Avatar
Moderator

SuperMember
Join Date: Jul 2007
Location: Webforumz 24/7
Age: 15
Posts: 3,812
Blog Entries: 9
Thanks: 2
Thanked 2 Times in 2 Posts
Re: first attempt at writting php form from scratch

Eesh why are you using iframes anyway? This would be something great to do in ajax!
Have you got this hosted anywhere? I'm not too sure what's happening with this iframe and it would be easier to see it.
Last Blog Entry: 3D Chess in your browser! (Mar 14th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Nov 5th, 2007, 23:36
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

Ajax? I've heard of and seen ajax on sites, but I have never used it and am completely unfamiliar with its structure and syntax. If you could point to a place that could give me a walk through example of an ajax form that would be great. Does it matter what kind of server the site will be on, (Apache by the way)?

The form I am working with right now is hosted at http://www.narthexwebdesign.com/clie...ontact_us.html

the post page is http://www.narthexwebdesign.com/clie...ds/request.php but it wont even load to see the source. So I'll put it here for you.

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
    font-size: 18px;
    font-weight: bold;
    color: #FF0000;
}
.style2 {color: #FF0000}
-->
</style>
</head>

<body>

<?php
// All variables

//Contact Name *
$fname = $_POST["fname"];
$lname = $_POST["lname"];
    $contactn = $fname." ".$lname;
//Date of the Event *
$month = $_POST["month"];
$day = $_POST["day"];
$year = $_POST["year"];
    $date = $month."/".$day."/".$year;
//Event Name *
$event_name = $_POST["event_name"];
//Picked Book *
$book = $_POST["book"];
//Event Details *
$details = $_POST["details"];
//Contact Phone Number *
$area = $_POST["area"];
$prefix = $_POST["prefix"];
$four = $_POST["four"];
    $phone = $area."-".$prefix."-".$four;
//Contact's email *
$contacte = $_POST["contacte"];
//Address *
$add1 = $_POST["add1"];
$add2 = $_POST["add2"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$country = $_POST["country"];
    $address = $contactn\r . $add1\r . $add2\r . $city.", ".$state." ".$zip\r$country\r;

//the email
$to = "andrew@narthexwebdesign.com, $contacte";
$subject = "$contactn is requesting Paul to speak at their event";
// The message
$message = "$contactn is requesting Paul Pettit to speak at the following event.\r
Event Name: $event_name\r
Event Date: $date\r
Requested Book Topic: $book\r\n
Contact Name: $contactn\r
Phone: $phone\r
email: $contacte\r
Address:\r$address\r\n
Event Details: \r$details";
$headers = "From: $contacte" . "\r\n" .
    "Reply-To: $contacte" . "\r\n" .
    "X-Mailer: PHP/" . phpversion();

mail($to, $subject, $message, $headers);
?> 
<center>
<span class="style1">Success!</span><br />
<span class="style2">We have received your email and will be in contact soon.</span>
</center>
</body>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Nov 6th, 2007, 09:48
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

Here's your problem line

$address = $contactn\r . $add1\r . $add2\r . $city.", ".$state." ".$zip\r$country\r;


WHen you are inserting special characters, put them in double quotes.. the same way you have done the space and comma.

ie:
$address = "{$contactn}\r{$add1}\r{$add2}\r{$city}, $state {$zip}\r{$country}\r;";


You won't get anywhere with these PHP errors Fix them first then have a look at ajax (which is exactly the same as what you are doing now except that you get javascript to post the form and display results without having to reload the page)..

Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)

Last edited by Rakuli; Nov 6th, 2007 at 09:50.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Nov 6th, 2007, 20:01
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

Thanks Rakuli,

Couple of questions, if you don't mind.
1. If I understand you right, I need to put the entire string in double quotes - not just the space and the comma. Correct?
2. What do the curly brackets ({}) do? Is there a reason you did not place them around the $state variable?

peace,
Andrew
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Nov 6th, 2007, 20:12
Rakuli's Avatar
SuperMember

SuperMember
Join Date: Sep 2007
Location: Australia
Age: 24
Posts: 956
Blog Entries: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

In the case of your string that has lots of embedded special characters, it is easier to place the entire string in double quotes.

The reason I surrounded some with curly braces is because it tells php that it is a variable.. The variables are close to each other and if they all run together, sometimes php gets confused and doesn't interpret them correctly.. The reason why I didn't out them around $state is because it has space either side and doesn't need it.

Cheers,
Last Blog Entry: The wannabe juggler's quest (Oct 27th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Nov 6th, 2007, 20:20
New Member
Join Date: Nov 2007
Location: Dallas, TX
Age: 29
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Re: first attempt at writting php form from scratch

thanks. that's great info!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
scratch game ahwell Flash & Multimedia Forum 13 Feb 28th, 2008 23:09
[SOLVED] First Attempt at Basic Image Gallery Not Working... Jack Franklin JavaScript Forum 1 Sep 30th, 2007 08:14
Template or from scratch Pádraig Starting Out 4 Apr 20th, 2007 01:11
setting up a poll from scratch camcool21 Webforumz Cafe 2 Dec 17th, 2006 14:40


All times are GMT. The time now is 22:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved