php code not echoed in html page

0 down vote favorite

I currently have this page I am working on: http://www.webauthorsgroup.com/new/template/index3.html

In the lower right corner is a form (php), but I can’t “echo” a text message after it has been submitted (for whatever reason).

My form is:

=================================================

[php]

Name

E-mail

Phone

Question/Comment

[/php]

=================================================

I currently have this page I am working on: http://www.webauthorsgroup.com/new/template/index3.html

In the lower right corner is a form (php), but I can’t “echo” a text message after it has been submitted (for whatever reason).

My form is:

[php]

Name

E-mail

Phone

Question/Comment

[/php]

=========================================================

the process.php is:

[php]<?php

if(isset($_POST[‘submit’]))
{

// Get Data
$name = strip_tags($_POST[‘name’]);
$email = strip_tags($_POST[‘email’]);
$phone = strip_tags($_POST[‘phone’]);
$url = strip_tags($_POST[‘url’]);
$message = strip_tags($_POST[‘message’]);
echo “Thank You!”;
}
// Send Message
mail( "[email protected]", “Inquiry From WebAuthorsGroup”,
“Name: $name\nEmail: $email\nPhone: $phone\nWebsite: $url\nMessage: $message\n”,
“From: Forms [email protected]” );
?>
[/php]

I need the “message sent” text echoed in the same div after submitting the form and I don’t want to convert my index page to index.php

Any help would be great!

One thing first, your form doesn’t seem to go anywhere (so it’s posting to itself), how do you get to process.php? Do you use javascript to capture the form submit and send the form there? If so it would be nice to get the javascript as well.

Here is the JS:

Ok, so what is actually failing here?

on this page: http://www.webauthorsgroup.com/new/template/index5.php, if you try using the form, it does not validate/process, yet on the original script (http://www.webauthorsgroup.com/new/template/form/index.php), it does.

Not sure what’s going on - trying a process of elimination…

Which browser do you use? Try to open your page with inspector turned on :wink:

Uncaught TypeError: Object [object Object] has no method 'validate' index5.php:95

Have you included whichever jquery validator plugin they are using?

Yes - if you view the source, it should show the following:

Ok, not sure why it happens, but it is definitely that error that is causing it not to work

Perhaps something get confused as you include different jquery library versions?
[php]

[/php]

removed 1.4 and used 1.10 - no difference…I do thank you for taking your time to look at it for possibilities…I will remove all elements and implement them one by one to determine I think

Final follow-up:

Ok, after half the day with a php migraine, I’ve FINALLY figured it out……I used a ” file_get_contents” php command and stripped out all the code from the working script and just kept the FORM elements! It is now working: http://www.webauthorsgroup.com/new/template/index.php

Want to thank you again for attempting to resolve this with me!

@ctguy44 Glad you solved the issue!

You’re website looks great, I know it’s still in development and you have a few wrinkles to iron out.

If you wanted to write some Tutorials for PHP help, I can add them to our tutorial library and link back to your site.

I hope you stick around, it’ll be great to have someone with your expertise helping out.

I do thank you for your kind words, but I am definitely not a php programmer - I just love what php does and forced myself to learn snippets here and there and my passion for solving and figuring things out (just in general) makes me a prime candidate to have my site built in php :slight_smile:

My site is being built on CSS3 and HMTL5 for the next generation of coding and if there’s anything I can help out with for anyone on this forum, I would be glad to help out if possible.

Thanks again!

ok, my website is now up and running! http://www.webauthorsgroup.com

This website was built in PHP, CSS, CSS3 and HTML5. I HIGHLY recommend viewing this website with a 17" widescreen monitor (1600x1200) AND either FireFox or Google Chrome browser. IE and other browsers will lose some functionality.

I want to thank everyone involved who assisted with me various code snippets which I was seeking assistance with and if there’s anything I can help out someone with, let me know!

Thanks! :slight_smile:

Sponsor our Newsletter | Privacy Policy | Terms of Service