NameSilo

PHP form question

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

faisj

Established Member
Impact
70
I have made 2 php files script.php
and contact.htm

contact.htm
HTML:
                  <p>Get your tickets:<br> 
                  <FORM 
                              action="script.php"
                              method="post">
                     Naam: <INPUT name=name 
                              size=10 
                              style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 100px;" 
                              value= ><br>
                      Aantal kaarten: <INPUT name=amountoftickets 
                              size=10 
                              style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 20px;" 
                              value= > <br>
                      E-mail adres: <INPUT name=email 
                              size=10 
                              style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 100px;" 
                              value= ><br>
                      Mobiel nummer: <INPUT name=mobilenr
                              size=10 
                              style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 80px;" 
                              value= ><br>
<p align=right>
                      <a href="script.php" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('submit','','images/submit_over.gif',1)"><img src="images/submit_up.gif" name="submit" width="49" height="18" border="0" align="absmiddle"></a>



script.php
PHP:
<?
$mail = popen("/usr/sbin/sendmail -t THE EMAIL ADDRESSl","w");
fwrite($mail,"From: $email\n");
fwrite($mail,"To: THE EMAIL ADDRESS\n");
fwrite($mail,"Subject: EMAIL underground\n");

fwrite($name,"\n");
fwrite($amountoftickets,"\n");
fwrite($mobilenr,"\n");
fwrite($mail,"SUBSCRIBE underground\n");
pclose($mail);include("dank.html");
?>

Could someone help me... it aint working...

- Faisj
 
Last edited:
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Change
Code:
fwrite($name,"\n");
fwrite($amountoftickets,"\n");
fwrite($mobilenr,"\n");
To
Code:
fwrite($mail, $name."\n");
fwrite($mail, $amountoftickets."\n");
fwrite($mail, $mobilenr."\n");
 
0
Close
I changed it but it still does not work...

I did not get any email.

I this piece of code correct? :
PHP:
$mail = popen("/usr/sbin/sendmail -t THE EMAIL ADDRESS","w");
fwrite($mail,"From: $email\n");
fwrite($mail,"To: THE EMAIL ADDRESSl\n");
fwrite($mail,"Subject: EMAIL underground\n");
 
Last edited:
0
Close
I've never sent an email like that before.

Check out mail().
 
0
Close
I dont understand it : (

I am not not good at all with php...

could you edit the script.php for me??? please...
(I am totally ready to pay some NP$'s)
 
0
Close
Change script.php to
PHP:
<?php

$message = "Name: $name\n
			Tickets: $amountoftickets\n
			Mobilenr: $mobilenr";
mail('-- YOUR EMAIL --', 'EMAIL underground', $message, 'From: '. $from . "\r\n");
include("dank.html");

?>
That should work, but it's not very secure.
 
Last edited:
0
Close
I got a email but only:

Name:

Tickets:

Mobilenr:

No information what i submitted has been send along.
Also the email: is not there..

the email should come from [email protected]
 
0
Close
PHP:
<?php

$email           = $_POST['email'];
$name            = $_POST['name'];
$amountoftickets = $_POST['amountoftickets'];
$mobilenr        = $_POST['mobilenr'];
$message         = "Email: $email\n
					Name: $name\n
					Tickets: $amountoftickets\n
					Mobilenr: $mobilenr";
					
mail('-- YOUR EMAIL --', 'EMAIL underground', $message, 'From: '. $from . "\r\n");
include("dank.html");

?>
 
Last edited:
0
Close
Again no info was send along:

I got:
Email:

Name:

Tickets:

Mobilenr:
 
0
Close
Ah.. I figured out the problem.. you have a link to script.php.. you aren't actually submitting the form.

Change contact.html to
Code:
<p>Get your tickets:<br>
<FORM action="script.php" method="post" name="form">
	Naam: 
	<INPUT name="name" size="10" style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 100px;" value="" /><br />
	Aantal kaarten: 
	<INPUT name="amountoftickets" size="10" style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 20px;" value="" /><br />
	E-mail adres: <INPUT name="email" size="10" style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 100px;" value="" /><br />
	Mobiel nummer: <INPUT name="mobilenr" size="10" style="BACKGROUND-COLOR: #FFFFFF; BORDER-BOTTOM: #F383A9 1px solid; BORDER-LEFT: #F383A9 1px solid; BORDER-RIGHT: #F383A9 1px solid; BORDER-TOP: #F383A9 1px solid; FONT-FAMILY: Arial; Helvetica; Microsoft Sans Serif; FONT-SIZE: 8pt; HEIGHT: 18px; WIDTH: 80px;" value="" /><br /> 
	<p align=right><a href="#" onclick="document.form.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('submit','','images/submit_over.gif',1)"><img src="images/submit_up.gif" name="submit" width="49" height="18" border="0" align="absmiddle"></a>
 
0
Close
Now i cant click on submit

is that because of the:

PHP:
<p align=right><a href="#" onclick="document.form.submit()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('submit','','images/submit_over.gif',1)"><img src="images/submit_up.gif" name="submit" width="49" height="18" border="0" align="absmiddle"></a>

a href="#" ?

Ps. I have send you some NP$'s, THANKS FOR THE HELP
I hope we can get it working
 
0
Close
You should be able to click it.. the onclick=".." submit's the form, sending the information to script.php. Do you have these files uploaded somewhere?
 
1
Close
Dan said:
You should be able to click it.. the onclick=".." submit's the form, sending the information to script.php. Do you have these files uploaded somewhere?

I am sending you the url by pm
 
0
Close
Just a side note, you might want to take your email address out of the code you posted. Just as a precautionary measure.

-Steve
 
0
Close
done but i cant remove it from dan's quotes

THANKS DAN - script is working now!
 
0
Close
I think I removed your email from all of my posts. :)
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back