Server Help

Trash Talk - PHP Form

Contempt+ - Sat Aug 27, 2005 1:42 pm
Post subject: PHP Form
I know that I've asked a couple of you already, but this is strange.

I made a form online using HTML with a responding .php page. That php page sends the data that was inserted in the form to my e-mail address.

Now, the strange part is, all of it works, except for 1 function/command.. (Can't think of the proper name right this minute). And it's right in the middle of the rest of the other commands/functions.

When I click Submit, it sends all the data, except for that one thing, lol.

Here's the code. Oh, and it's a lyric submission form. I got tired of all the crap that's on the lyric websites now, so I'm making one.

Form:
Code: Show/Hide
   <tr>
     <td width="16%" height="22">
     <b><font face="Verdana" size="1">Album:</font></b></td>
     <td width="84%" height="22">
     <font face="Verdana" size="1"><b>
     <input type="text" name"cdtitle" size="34" value=""></b></font></td>
   </tr>


Responding page:
Code: Show/Hide
<?php
  $title = $_POST['title'];
  $artist = $_POST['artist'];
  $cdtitle = $_POST['cdtitle'];
  $body = $_POST['body'];
  $note = $_POST['note'];
  $email = $_POST['email'];


  mail( "my e-mail", "Lyrics",
    "Title: $title; Artist: $artist; Album: $cdtitle; Lyrics: $body; Comments: $note", "From: $email" );

?>


Now, I'm still learning php, but I don't understand why this isn't working. It's the "Album" section, and on the php page, its called "cdtitle". I've tried a few things, and nothings worked. Any help would be appreciated. Thanks.
Maverick - Sat Aug 27, 2005 2:49 pm
Post subject: Re: PHP Form
Contempt+ wrote:
Code: Show/Hide
name"cdtitle"

forgot the =
Dr Brain - Sat Aug 27, 2005 3:20 pm
Post subject:
Nice catch. I looked through the whole thing and never saw that.
Donkano - Sat Aug 27, 2005 3:24 pm
Post subject:
Dr Brain, simple way of detecting errors:
1st Page 2000
Contempt+ - Sat Aug 27, 2005 5:47 pm
Post subject:
Ok, but what I don't understand, is that I don't have the = sign for any of the other names, and it works.
Solo Ace - Sat Aug 27, 2005 6:01 pm
Post subject:
What the... you've been trying to do this for a month already.
Try packet logging on the client's side and/or echo'ing the results on the server's side, maybe that makes it a little easier to find out.
Donkano - Sat Aug 27, 2005 6:21 pm
Post subject:
Contempt+ wrote:
Ok, but what I don't understand, is that I don't have the = sign for any of the other names, and it works.


Use:
Code: Show/Hide
   <tr>
     <td width="16%" height="22">
     <b><font face="Verdana" size="1">Album:</font></b></td>
     <td width="84%" height="22">
     <font face="Verdana" size="1"><b>
     <input type="text" name="cdtitle" size="34" value=""></b></font></td>
   </tr>


Edit:
Reason why is "name" uses the same syntax as "id" and "value" does.

Value is what what appear in the input to the Client's GUI. Name and ID is for labelling.

Name is called from the <form>'s action="" script and can be called from JavaScript

ID is generically used for the <label> command.
Donkano - Sat Aug 27, 2005 6:26 pm
Post subject:
Also, size 1 is pretty small, I would reccomend size 2.
Contempt+ - Sat Aug 27, 2005 11:42 pm
Post subject:
Oh, I see. I thought you guys were talking about the PHP end of it. I see what I did wrong.

Thanks guys.
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group