PDA

View Full Version : alternative to php forms?


yurg
03-24-2007, 05:35 PM
hi im new to forms, not had much luck at the moment, ive been trying the php tutorial and that doesnt work, so im guessing that my server (myserverworld.net) doesnt support php. is there any other way that i can get an effective form to send the info to my email account. have a look at the page im trying to produce a form from and could you let me know where i can go from there!

many thanks

http://www.recycleyourjeans.com/get%20recycling%202.html

davidj
03-24-2007, 06:27 PM
who is your hosting company

post link

Paws
03-25-2007, 12:20 PM
hi im new to forms, not had much luck at the moment, ive been trying the php tutorial and that doesnt work, so im guessing that my server (myserverworld.net) doesnt support php. is there any other way that i can get an effective form to send the info to my email account. have a look at the page im trying to produce a form from and could you let me know where i can go from there!

many thanks

http://www.recycleyourjeans.com/get%20recycling%202.html


Ok I'll try this agian:

Create a file called phpinfo.php with this inside:

<?php
phpinfo();
?>
and upload it and execute it.

If it shows you a PHP version page then it has PHP working; also check your link your form is submitting to:

http://www.recycleyourjeans.com/www.recycleyourjeans.com/sendresults.php

I got this after clicking submit, so rather post to just sendresults.php.

chriskq
03-25-2007, 12:43 PM
can always fall back on a cgi script. no php needed, works with plain html.

let me kno if u need me to post one for you. or head over to matts scripts.

yurg
03-28-2007, 12:28 PM
sorry for late reply guys. my host does support php, but im still stuck, im using the php script that ramandeep has in his tutorial, but when i click submit on the form, it says "http 405 method not allowed" and that there must be a programming error on the website. do you know what that could mena at all?

yurg
03-28-2007, 12:38 PM
also, where am i supposed to be saving the php script file on my hosts server?

davidj
03-28-2007, 12:58 PM
post the code from the form

yurg
03-28-2007, 01:23 PM
<<<form action="sendresults.php" method="post" name="Contact" id="Contact">
<label>
<div align="right"><span class="style1">Title
</span>
<input type="text" name="textfield3" />
<br />
<br />
<span class="style1">First Name</span>
<input type="text" name="textfield" />
<br />
<br />
<span class="style1">Surname
<input type="text" name="textfield2" />
<br />
<br />
Address Line 1
<input type="text" name="textfield4" />
<br />
<br />
Address Lines 2
<input type="text" name="textfield5" />
<br />
<br />
Address Line 3
<input type="text" name="textfield6" />
<br />
<br />
Town/City
<input type="text" name="textfield8" />
<br />
<br />
Postcode
<input type="text" name="textfield9" />
<br />
<br />
Email Address </span>
<input type="text" name="textfield10" />
<br />
<br />
<input type="submit" name="Submit" value="Submit" />
<input name="Reset" type="reset" id="Reset" value="Reset" />
</div>
</label>
</form>
>>

yurg
03-28-2007, 01:26 PM
sorry bout that, ive forgotten how to enter code into a thread, been a while!

domedia
03-28-2007, 02:14 PM
Can you post the sendresults.php as well?

yurg
03-28-2007, 02:45 PM
<?php
//--------------------------Set these paramaters--------------------------

// Subject of email sent to you.
$subject = 'Results from Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'charlie@softwalker.co.uk';

// Where to redirect after form is processed.
$url = 'http://www.recycleyourjeans.com/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

yurg
03-29-2007, 06:36 PM
is there anyone who can help me with this as im on a very tight deadline and i dont really know where to go from here. many thanks

domedia
03-30-2007, 12:29 PM
I think it means that the url in action, the php file, is not allowed to receive data from POST. Are you *sure* you have PHP running on the server? Did you set up a phpinfo page?

yurg
03-30-2007, 12:54 PM
php is definitely running, i use plusnet as my server, i havnt set up a php info page, how does that work? and how do i go about doing it?

domedia
03-30-2007, 01:11 PM
php is definitely running, i use plusnet as my server, i havnt set up a php info page, how does that work? and how do i go about doing it? How do you know PHP is running? Previous poster in this thread gave you phpinfo information.

yurg
03-30-2007, 01:15 PM
ummm, i didnt realsie that you needed to set up a phpinfo page before it would run, i thought that all you needed was a server that would support php. have i got things totally wrong then?

davidj
03-30-2007, 01:23 PM
you dont need to set an info page to get php working but you can use it to make sure php is installed and working

yurg
03-30-2007, 01:32 PM
how do i do that? ive been looking for a fully comprehensive tutorial to setting up an online form, and everything that i have followed has failed so far. do you know where i can find one? because the one ramandeep has put up doesnt work for me! sorry to be a pain about this but im under pressure to make this work and im still only an amateur, many thanks

davidj
03-30-2007, 01:40 PM
drop a file on the server with ...

<? phpinfo() ?>

then run it.

this will display info about the installed php

if you get back an info page then we will know its working and can move onto the problem you have

domedia
03-30-2007, 01:56 PM
http://www.recycleyourjeans.com/sendresults.php -page not found as well

yurg
03-30-2007, 02:05 PM
sorry, i took the sendresults page off when i was trying something else before, its there now. how do u mean run a file once its on the server, how do i do that?cheers

davidj
03-30-2007, 02:07 PM
write the file

upload the file

open the file in your browser through http

yurg
03-30-2007, 02:16 PM
ok ive done that, called the file phpinfo, tried opening it up using http://www.recycleyourjeans.com/phpinfo and nothing happened, wot am i doing wrong?

davidj
03-30-2007, 02:17 PM
what have you written in the file

yurg
03-30-2007, 02:24 PM
i just wrote a line of text, what sort of file should i be saving it as?

davidj
03-30-2007, 02:26 PM
in the file write

<? phpinfo(); ?>

nothing else just that.

yurg
03-30-2007, 02:32 PM
well thats done but no change,

davidj
03-30-2007, 03:24 PM
the file exists but your host doesnt support it. Contact them and advise them you want PHP

you need a host with PHP support

yurg
03-30-2007, 03:37 PM
Files containing PHP must be stored in your CGI space, not your regular webspace. They should not be put in the cgi-bin though.
Upload all files containing PHP to your CGI webspace - ccgi.username.plus.com
Upload PHP files in ASCII format.
Set file permission to 755 for PHP files.

i just read my hosts website and this is what they said i should do, how do i go about uploading to ccgi.username.plus.com, and what is ASCII format?

heres where i found this out - http://www.plus.net/support/webspace/cgi_php/beginners_guide_php.shtml

davidj
03-30-2007, 03:43 PM
i dont know why they do it this way but thy must have a reason

you need to contact them and ask for help. They are in a better position to give better advice and help