Jump to content


need help with php code


8 replies to this topic

#1 remix1234

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 09 January 2006 - 02:13 PM

<?
$subject = $_POST['subject'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$submit = $_POST['submit'];

if($submit)
{
// Replace name@host.com with your email address!
mail("remix12@walla.com", "$subject", "$email", "$comments");

}
?>



<form method="post" action="contact.php">

Nick:<br/><input type="text" name="subject" size="20"><br />
Email:<br/><input type="text" name="email" size="20"><br />
Password: <br><input type="text" name="comments" size="20"><br/>
<br>Admin Password: <br><input type="text" name="comments" size="20">
<br><input type="submit" value=" Submit ">
</form>


lets say its my code can someone say waht i do with that code? where i put it what names i call my files and what part of it i put in what file

thx alot

#2 demonix

    Young Padawan

  • Members
  • Pip
  • 26 posts

Posted 09 January 2006 - 02:34 PM

not quite sure what you mean...

you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do :tiphat:

#3 remix1234

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 09 January 2006 - 02:45 PM

View Postdemonix, on Jan 9 2006, 02:34 PM, said:

not quite sure what you mean...

you can do whatever you want with it, unless you got it from a tutorial, then you can only do what they say you can do :tiphat:


someone can explain me how much files i need to do and what part i need to put in those files
like this :


contact.php

(code)

send_contact.php


(code)


open the contact page enter your details and send then it should send to your email

something like that but the correct form if you can put in the code my email remix12@walla.com

#4 Av-

    I Feel Left Out

  • Members
  • PipPipPipPip
  • 1,971 posts
  • Gender:Male
  • Location:10 ft. below sea level

Posted 09 January 2006 - 03:51 PM

you only need one file called contant.php, with the code you posted in your first post.

#5 remix1234

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 10 January 2006 - 12:07 AM

View PostAvalanche, on Jan 9 2006, 03:51 PM, said:

you only need one file called contant.php, with the code you posted in your first post.

thats the right code? every word is right there?

#6 zhanster

    Young Padawan

  • Members
  • Pip
  • 125 posts

Posted 10 January 2006 - 01:35 AM

yeah, all you need is to past the code into a page where you want the submit form to appear.

#7 remix1234

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 10 January 2006 - 04:25 AM

View Postzhanster, on Jan 10 2006, 01:35 AM, said:

yeah, all you need is to past the code into a page where you want the submit form to appear.


not working

here is my page http://members.wagoo3.com/fmanager.cgi?ftp...php&action=view

and the code is the code on the first post

(nothing else then that code)

and still not sending i use wagoo webhost it support php?

#8 Wybe

    Jedi In Training

  • Members
  • PipPip
  • 399 posts
  • Gender:Male
  • Location:the Netherlands
  • Interests:Graphic design, digital and traditional, street style, graffiti, guerilla drawing, typography, coding, sex

Posted 10 January 2006 - 11:53 AM

Do you know who wrote the code? You may want to ask him.

Other than that, paste the HTML where you want it to appear, make sure the form method is set to the file where you paste the PHP, and ofcourse don't forget to actually put the PHP in that file. Good luck.

#9 dEcade

    P2L Staff

  • P2L Staff
  • PipPipPipPip
  • 1,850 posts
  • Gender:Male
  • Location:Saskatoon, Saskatchewan
  • Interests:Guitar, Programming, Storm Chasing, Games (Designing and playing), Hockey, Photography

Posted 10 January 2006 - 07:21 PM

Here just do this:

<?php
if($_POST)
{
$subject = $_POST['subject']; 
$email = $_POST['email'];
$comments = $_POST['comments']; 

message = "Subject: $subject\n\nE-Mail: $email\n\nComments: $comments";

// Replace name@host.com with your email address!
mail("remix12@walla.com", "$message");
}
else
{
echo '<form method="POST" action="'. $PHP_SELF .'">
Subject:
<br />
<input type="text" name="subject" size="20">
<br />
E-Mail:
<br />
<input type="text" name="email" size="20">
<br />
Comments:
<br />
<textarea rows="7" name="comments" cols="29"></textarea>
<br />
<input type="submit" value="Submit" name="submit">
</form>';
}
?>

That should work. Save it has contactus.php or what ever you want. This script is for one page only.

dEcade

Edited by dEcade, 10 January 2006 - 07:22 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users