The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Contact Form, Contact Form
Carlos S.
post Oct 22 2014, 12:23 PM
Post #1


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



So im making a contact form using PHP, Javascript and my PHP my file to send the message for it to function is residing in my server along side my index file with <script> calling out the php file but it is not working. Ive attached my index and php file.


Attached File(s)
Attached File  main.Master.php ( 5.09k ) Number of downloads: 174
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 22 2014, 01:45 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(Carlos S. @ Oct 23 2014, 02:23 AM) *

So im making a contact form using PHP, Javascript and my PHP my file to send the message for it to function is residing in my server along side my index file with <script> calling out the php file but it is not working. Ive attached my index and php file.


In what way is it "not working"? Have you tried debugging it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 01:55 PM
Post #3


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



No I havent tried that how do you do that? What I mean is it doenst send the message to its respective mail recipient in the .php file.

This post has been edited by Carlos S.: Oct 22 2014, 01:55 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 22 2014, 03:02 PM
Post #4


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(Carlos S. @ Oct 23 2014, 03:55 AM) *

No I havent tried that how do you do that? What I mean is it doenst send the message to its respective mail recipient in the .php file.


Sure, it doesn't work. But you have to work out why, and the quickest way to do this is not just to stare at the program, wondering what the problem is, nor is it to post a copy of the program here and hope that someone else will stare at it until they see the problem. You have to use "diagnostics" -- usually this just means using echo to see what variables hold. If you look at the program and think "This variable $msg contains the message", then you CHECK. echo "<p>message /$msg/</p>"; will show you whether it really does hold what you think it does. (I am not trying to be unhelpful, but I think it is quite counterproductive for other people to look at your program and try to debug it in their heads.)
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 03:07 PM
Post #5


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



What are you talking about I didnt say "im staring at the program", or "someone to work it out for me" I posted it so people could know what im looking at....your coming off a little to strong man its best if you hadnt replied to this. All im asking for is help I though this is what this website was about..sorry.

This post has been edited by Carlos S.: Oct 22 2014, 03:08 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 03:29 PM
Post #6


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



All you have to do is tell me is the what I could do...Im not saying to solve it for me this is all you had to say: "You have to use "diagnostics" -- usually this just means using echo to see what variables hold. If you look at the program and think "This variable $msg contains the message", then you CHECK. echo "<p>message /$msg/</p>"; will show you whether it really does hold what you think it does."
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 22 2014, 03:37 PM
Post #7


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Carlos S. @ Oct 22 2014, 07:23 PM) *

Ive attached my index and php file.

That file seems to contain both ASP(?) and PHP. Not even sure if you can run both these script languages in the same file, in any case doing so seems like an unnecessary complication.

The file also contains a form's start- and end tags, but no actual form elements (like text fields). Are the latter supposed to be inserted with ASP, or javascript?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 04:16 PM
Post #8


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



Sorry I put the wrong files in look at these. and thanks for your help and not being a douche like some people ^.


Attached File(s)
Attached File  process.php ( 891bytes ) Number of downloads: 212
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 22 2014, 05:00 PM
Post #9


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Carlos S. @ Oct 22 2014, 11:16 PM) *

Sorry I put the wrong files in look at these. and thanks for your help and not being a douche like some people ^.

That's just some PHP code. Still no HTML form...
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 05:14 PM
Post #10


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



QUOTE(Christian J @ Oct 22 2014, 05:00 PM) *

QUOTE(Carlos S. @ Oct 22 2014, 11:16 PM) *

Sorry I put the wrong files in look at these. and thanks for your help and not being a douche like some people ^.

That's just some PHP code. Still no HTML form...



Attached File(s)
Attached File  main.html ( 4.33k ) Number of downloads: 257
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 05:14 PM
Post #11


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



here it is.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 22 2014, 05:24 PM
Post #12


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 22 2014, 05:55 PM
Post #13


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Carlos S. @ Oct 23 2014, 12:14 AM) *

here it is.

That one is lacking form fields, just like the one in your first post.

QUOTE
So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?

I don't think it's possible, and why complicate it like that in the first place? I'd stick with either PHP or ASP, and use static HTML for the form itself.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 23 2014, 02:34 AM
Post #14


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(Carlos S. @ Oct 23 2014, 07:24 AM) *

So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?


It doesn't help to have different systems together -- and means you need to be an expert in all but one of them, at least.

Sorry, I didn't look at your submitted file originally, because you didn't ask a specific question. But if you want to get the php mail submission script working, the way to test it is with a plain form, so that all output from the mail script appears directly in your browser. Then you stick in some echo "...diagnostic..." lines to work out what is happening.

Did you really write all this yourself? Or which bits did you write yourself? Is there a particular reason to use ajax to submit the mail?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 23 2014, 10:35 AM
Post #15


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



QUOTE(Christian J @ Oct 22 2014, 05:55 PM) *

QUOTE(Carlos S. @ Oct 23 2014, 12:14 AM) *

here it is.

That one is lacking form fields, just like the one in your first post.

QUOTE
So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?

I don't think it's possible, and why complicate it like that in the first place? I'd stick with either PHP or ASP, and use static HTML for the form itself.



You mean HTML & PHP or HTML & ASP?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 23 2014, 10:45 AM
Post #16


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



QUOTE(Brian Chandler @ Oct 23 2014, 02:34 AM) *

QUOTE(Carlos S. @ Oct 23 2014, 07:24 AM) *

So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?


It doesn't help to have different systems together -- and means you need to be an expert in all but one of them, at least.

Sorry, I didn't look at your submitted file originally, because you didn't ask a specific question. But if you want to get the php mail submission script working, the way to test it is with a plain form, so that all output from the mail script appears directly in your browser. Then you stick in some echo "...diagnostic..." lines to work out what is happening.

Did you really write all this yourself? Or which bits did you write yourself? Is there a particular reason to use ajax to submit the mail?


No I didnt write all myself I only wrote the HTML....My company that I work for wants a lightbox contact form in there website...Is there another way to add this lightbox contact form?....and what do your mean a plain form to test it?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 23 2014, 10:46 AM
Post #17


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



QUOTE(Christian J @ Oct 22 2014, 05:55 PM) *

QUOTE(Carlos S. @ Oct 23 2014, 12:14 AM) *

here it is.

That one is lacking form fields, just like the one in your first post.

QUOTE
So im guessing that I am working with asp and PHP files together and yeah im assuming they dont work together.....Is it possible to make them work together?

I don't think it's possible, and why complicate it like that in the first place? I'd stick with either PHP or ASP, and use static HTML for the form itself.


What do you mean by "form fields"?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Carlos S.
post Oct 23 2014, 10:59 AM
Post #18


Newbie
*

Group: Members
Posts: 14
Joined: 22-October 14
Member No.: 21,708



Im not sure what theses mean:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="main.Master.vb" Inherits="IOG.Site1" %>

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/main.Master" CodeBehind="Contact.aspx.vb" Inherits="IOG.Contact" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

In order for me to change them from .aspx files to HTML files what do need to take out?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Oct 23 2014, 12:41 PM
Post #19


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(Carlos S. @ Oct 23 2014, 05:35 PM) *

QUOTE

I'd stick with either PHP or ASP, and use static HTML for the form itself.

You mean HTML & PHP or HTML & ASP?

Yes. Personally I'd use HTML and PHP, but I don't know how your web site and server is configured. Maybe you have to use ASP, in which case you might need to find an ASP form script.

QUOTE
Is there another way to add this lightbox contact form?....

Afraid I have no idea what that is. unsure.gif

QUOTE
and what do your mean a plain form to test it?

Probably Brian meant using just HTML for the actual form (no javascript).

QUOTE
What do you mean by "form fields"?

A contact form usually contains a few textfields and a TEXTAREA to type in, and a submit button to submit the form with.

QUOTE
Im not sure what theses mean:

Looks like ASP code. You might simply remove it, but why did this code get in there in the first place?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Oct 23 2014, 12:58 PM
Post #20


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



QUOTE(Christian J @ Oct 24 2014, 02:41 AM) *

QUOTE(Carlos S. @ Oct 23 2014, 05:35 PM) *

QUOTE

I'd stick with either PHP or ASP, and use static HTML for the form itself.

You mean HTML & PHP or HTML & ASP?

Yes. Personally I'd use HTML and PHP, but I don't know how your web site and server is configured. Maybe you have to use ASP, in which case you might need to find an ASP form script.


Of couse it's simpler to use the same system everywhere, but if an ASP generated page makes a standard call to a php-generated page, it should all work perfectly. It's possible that the jquery ajax call might use a nonstandard calling convention, but unlikely. I guess this is some sort of corporate page, so no doubt the asp stuff is required by management, and you can't remove it. It is not meaningful to talk about "converting asp to html".

QUOTE

QUOTE
Is there another way to add this lightbox contact form?....

Afraid I have no idea what that is. unsure.gif

QUOTE
and what do your mean a plain form to test it?

Probably Brian meant using just HTML for the actual form (no javascript).


I imagine the "lightbox" is one of those horrible things that means you can't read the thing you are commenting on. Company types love them, because they get an illusion of power.
Yes, of course you have to test the bits separately. Write a standard html form to call the mail script, and see if it works. And so on, testing parts until you eliminate all the problems and it works as desired.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 24th April 2024 - 06:18 PM