Website Coding

Stuck on a line of code? Find resources and post your coding questions here.

Forum Sponsor (Advertise with us)
Reply
 
Thread Tools Display Modes
    #1 (permalink)  
Old 04-15-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default PHP Form works, but not when added to context of page
I came across some assistance with a PHP form. However here's my problem.
The form by itself, will preview and work fine in the browser. But once I add it to my webpage (in place of my current form), my page won't load at all. So something isn't compatible somewhere with the form, and my page. Because my current form works fine (from a preview perspective, not from a functionality perspective).

So in summary...
1.) current form previews fine http://www.jacksonao.com/contactus.html
2.) new form will preview fine by itself
3.) webpage will not preview at all when current form is replaced with new form.

any tricks?

Here's the code for my new form:

<form method="post" action="sendeail.php">

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />

Your Name: <br />
<input type="text" name="visitor" size="60" />
<br />
Your Business Name:<br />
<input type="text" name="visitor business" size="60" />
<br />
Your Email Address:<br />
<input type="text" name="visitor email" size="60" />
<br />
Your Business URL:<br />
<input type="text" name="visitor web address" size="60" />
<br />
Your Phone Number:<br />
<input type="text" name="visitor phone" size="60" />
<br />
<br />
Please describe the types of information or services you are interested<BR />
in receiving from Jackson Administrative Outsourcing.
<br />
<textarea name="notes" rows="10" cols="65"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
</form>
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #2 (permalink)  
Old 04-15-2008
Codehead's Avatar
Administrator
Company name: Codehead LLP
My latest blog post: Mac Performance Benchmark App
 
Join Date: Apr 2007
Location: WA
Posts: 175
Default Re: PHP Form works, but not when added to context of page
For a PHP form to work, your hosting package must support PHP, if it does, then the extension of your page must be PHP that is the file name of the page must be contactus.php rather than contactus.html
This is because the PHP extension (.php) tells your web server that this page contains PHP code.
__________________
"Imagination is more important than knowledge."
Albert Einstein
Reply With Quote
    #3 (permalink)  
Old 04-16-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: PHP Form works, but not when added to context of page
Ok, thanks codehead I tried changing the extention and infact it still didn't work. So it turns out our server doesn't support PHP, I needed to use ASP. So through some trial and error and some advise from my web host company, I have something that works.... FINALLY! UGH.

I definitely figured out that creating a form is a lot more work than just using a template. There are many interacting variables that determine if it will or will not work.

here's the final product http://www.jacksonao.com/contactus.html
test it anyone, if you want
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
    #4 (permalink)  
Old 04-16-2008
Tess's Avatar
Senior Member
Company name: Codehead, LLP
Latest blog post: SEO Q&A
 
Join Date: Apr 2007
Location: Portland, OR
Posts: 9,131
Blog Entries: 3
Default Re: PHP Form works, but not when added to context of page
Looks great Sarah!

Yes, it would be SO nice if website mods and 'accessories' could all be 'plug and play' but there are a multitude of factors that go into it. You're learning so much though and as a business owner in the internet age there is no greater asset than having at least marginal control over your website!
__________________
Create a welcome packet for new clients with this guide and free templates!

(Available in PDF and Kindle versions)
Reply With Quote
    #5 (permalink)  
Old 04-16-2008
Tess's Avatar
Senior Member
Company name: Codehead, LLP
Latest blog post: SEO Q&A
 
Join Date: Apr 2007
Location: Portland, OR
Posts: 9,131
Blog Entries: 3
Default Re: PHP Form works, but not when added to context of page
Hi Sarah, I'm about to send you a test message and noticed that the phone field it says

Your email phone number
(But you have a field for email above so much be a typo)
__________________
Create a welcome packet for new clients with this guide and free templates!

(Available in PDF and Kindle versions)
Reply With Quote
    #6 (permalink)  
Old 04-16-2008
Tess's Avatar
Senior Member
Company name: Codehead, LLP
Latest blog post: SEO Q&A
 
Join Date: Apr 2007
Location: Portland, OR
Posts: 9,131
Blog Entries: 3
Default Re: PHP Form works, but not when added to context of page
One last note, now that I've sent a test...

The page title for the 'Thank you' page after sending needs to be looked at...it reads 'Thank you for visiting inquirng with ...... etc. etc.'
__________________
Create a welcome packet for new clients with this guide and free templates!

(Available in PDF and Kindle versions)
Reply With Quote
    #7 (permalink)  
Old 04-16-2008
JacksonAO's Avatar
Contributing Member
 
Join Date: Mar 2008
Location: Jackson, MI
Posts: 235
Default Re: PHP Form works, but not when added to context of page
Thanks Tess, the test worked. And I think I fixed the typos. That's what happens when you stare at the same page for too long
__________________
Sarah Bernstein
Jackson Administrative Outsourcing

www.jacksonao.com
Reply With Quote
Reply

Thread Tools
Display Modes

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Social networking sites - what works, which do you use? Tess Social Media Marketing 31 02-07-2008 08:19 PM


All times are GMT -4. The time now is 11:19 AM.

International Virtual Assistants Association
Project Management for Virtual Assistants
Work from Home | Become A Virtual Assistant
Virtual Assistant Directory
Affordable Logo Design
Virtual Assistant Contracts
Virtual Assistant Forums Advertising

© Virtual Assistant Forums 2012
All content and images are protected under copyright law and may not be reproduced in any way without express written consent.