Web Hosting Forum | Lunarpages


*
Welcome, Guest. Please login or register.
Did you miss your activation email?



Login with username, password and session length
May 16, 2012, 07:19:27 PM

Pages: [1]   Go Down
  Print  
Author Topic: need help getting this to work.. a paste from a website  (Read 752 times)
stmary6
Newbie
*
Offline Offline

Posts: 4


WWW
« on: July 05, 2004, 05:50:16 PM »

Create Custom Mailboxes using cPanel
If you are using cPanel and you want to add an automated email signup form to your web site that's so easy.

First create an html form and get the following information from user :

- New Email Address.

- Password.

- ... (other information are not required.)

Now set the action of this form to "signup.php" with the POST method and set the value to your email address.

Example :

<FORM name=a method=POST action="signup.php" autocomplete=off>

<input type="hidden" name="to" value="your email address">

Now use the following code as "signup.php" :

----------

<?php
$ok = TRUE;
$file = fopen ("http://username:password@Server's IP:2082/frontend/Xskin/mail/doaddpop.html?email=$NewEmail&domain=$domain&password=$Password&quota=50", "r");
if (!$file) {
$ok = FALSE;
$target = "error.htm";
}
while (!feof ($file)) {
$line = fgets ($file, 1024);
if (ereg ("already exists!", $line, $out)) {
$ok = FALSE;
$target = "error.htm";
}
}
fclose($file);
if ($ok) {
$target = "done.htm";
$form_fields=array_keys($HTTP_POST_VARS);
$temp="\n";
while($field=array_pop($form_fields)){
$temp.=" $field : = $HTTP_POST_VARS[$field] \n";
}
mail($HTTP_POST_VARS['to'],"Free Email",$temp);
}
header("location:$target");
?>

----------

username & password = the same as username & password to your cPanel control panel.

Server's IP = Primary Server's IP

Xskin = It may change due to your cPanel skin.

Qyata = Size of the new mailbox in megabyte.

error.htm = If the email address is already exists or there is an error during the operation this page will be shown.

done.htm = If the email is created successfully this page will be shown and an email will be sent to your email address.
Logged
leighsww
* The Tough Love Cuddly One *
Berserker Poster
*****
Offline Offline

Posts: 13870


WWW
« Reply #1 on: July 17, 2004, 04:34:51 PM »

I'm not sure if you got this resolved already since your post is several days old, but if you didn't then take the word "php" out of the <?php.  It should be just <?

Also, replace the "your email address" with your actual email addy for this line:

Code:
<input type="hidden" name="to" value="your email address">
Logged
TranzNDance
Princess of Naboo
Berserker Poster
*****
Offline Offline

Posts: 11809



WWW
« Reply #2 on: July 17, 2004, 04:39:40 PM »

Um, actually, <?php is the more kosher way to write the opening bracket. Smile  

stmary6, could you please provide more details? Is it just not working? Is it giving errors?
Logged

Grr..!! Luff Ya Grr..!! Luff Ya Grr..!! Luff Ya
leighsww
* The Tough Love Cuddly One *
Berserker Poster
*****
Offline Offline

Posts: 13870


WWW
« Reply #3 on: July 17, 2004, 04:41:40 PM »

Quote from: TranzNDance
Um, actually, <?php is the more kosher way to write the opening bracket.


Someone had a problem in another thread, and when they removed the word php it worked for them, so I figured that may do it.

I'm not all that PHP literate, so you'll have to help him/her from here, Thu  Luff Ya
Logged
TranzNDance
Princess of Naboo
Berserker Poster
*****
Offline Offline

Posts: 11809



WWW
« Reply #4 on: July 17, 2004, 04:49:36 PM »

Quote from: leighsww
Someone had a problem in another thread, and when they removed the word php it worked for them, so I figured that may do it.

I'm not all that PHP literate, so you'll have to help him/her from here, Thu  Luff Ya

Could it had been that they had used
Code:
<? php

That wouldn't work. Well, unless I get feedback on the current script problem, I wouldn't know where to focus my look at the code. Well, I'm just too lazy to look through the whole thing. Razz
Logged

Grr..!! Luff Ya Grr..!! Luff Ya Grr..!! Luff Ya
leighsww
* The Tough Love Cuddly One *
Berserker Poster
*****
Offline Offline

Posts: 13870


WWW
« Reply #5 on: July 17, 2004, 05:06:49 PM »

Thu, I found the thread where the person had to remove the php part to get it working, just in case this has to do with anything:

http://www.lunarforums.com/forum/viewtopic.php?p=112442#112442
Logged
TranzNDance
Princess of Naboo
Berserker Poster
*****
Offline Offline

Posts: 11809



WWW
« Reply #6 on: July 17, 2004, 05:21:34 PM »

'tis odd. I put into one of my own scripts <?PHP like the person's script had and it still worked. Confused
Logged

Grr..!! Luff Ya Grr..!! Luff Ya Grr..!! Luff Ya
leighsww
* The Tough Love Cuddly One *
Berserker Poster
*****
Offline Offline

Posts: 13870


WWW
« Reply #7 on: July 17, 2004, 05:27:34 PM »

LOL, go figure  Smile

Strange things happen.  Look at this thread:

http://www.lunarforums.com/forum/viewtopic.php?t=14081

Nobody, till this day, can still figure out why she can't get email with the 2 & 3 baby form when the 1 baby form sends just fine to her LP addy.

It worked on my server, but not on hers. Weird.
Logged
Pages: [1]   Go Up
  Print  
 
Jump to: