Add to Google

Email Problem - register_globals = on ?

Pages: 1, 2
free web hosting
Open Discussion > Xisto Network Sites > Trap17 dot NET Forum (Archive)

Email Problem - register_globals = on ?

silverkaiser
i currently facing problem for the mail tutorial from www.ibdhost.com
it shown like this :
QUOTE

Bonus Tutorial
Email Form
n PHP Script
Latest Features
PHP Script hides your email address i.e. no email address in the form.
PHP Script checks for required email (format) & blanks! !
Copy n Paste section now includes code to validate to XTHML 1.0

Overview: This free email contact script includes a check for blank fields and a check for the correct email format i.e. more POWER - all using PHP (NO JAVASCRIPT REQUIRED smile.gif
For form code that includes more options - types of input, visit the Feedback Form tutorial.
Another example that automatically sends copies to sender is the Free Tell-A-Friend Form tutorial.

The advantage of sending contact email with a php form is that your email address is hidden from spam robots ... that look for 'mailto' in the code.

Required: A PHP host that does NOT block mail() (safe_mode OFF and register_globals on).

VIP: Not sure about the mail() function? Not sure about Safe mode - register globals. See notes at bottom of page.

Step 1: Copy and paste the e-mail Form Code into a 'contact.php' page (must be a html/php page on a server that allows php!).

Step 2: Copy n paste the sendeail.php code into a new file. Change the YourEmail section to include your email address. Then check (or modify) the link at the bottom (contact.php) to point to the desired Next Page. Save the file as 'sendeail.php' (as ASCII file).

Step 3: Upload both files as ASCII i.e. upload the same way as .html files. Be sure both files are in the same folder on the server.



E-mail Form Code (contact.php)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Form </title>
</head>
<body>

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

<!-- DO NOT change ANY of the php sections -->
<?php
$ipi = getenv("REMOTE_ADDR");
$httprefi = getenv ("HTTP_REFERER");
$httpagenti = getenv ("HTTP_USER_AGENT");
?>

<input type="hidden" name="ip" value="<?php echo $ipi ?>" />
<input type="hidden" name="httpref" value="<?php echo $httprefi ?>" />
<input type="hidden" name="httpagent" value="<?php echo $httpagenti ?>" />


Your Name: <br />
<input type="text" name="visitor" size="35" />
<br />
Your Email:<br />
<input type="text" name="visitormail" size="35" />
<br /> <br />
<br />
Attention:<br />
<select name="attn" size="1">
<option value=" Sales n Billing ">Sales n Billing </option>
<option value=" General Support ">General Support </option>
<option value=" Technical Support ">Technical Support </option>
<option value=" Webmaster ">Webmaster </option>
</select>
<br /><br />
Mail Message:
<br />
<textarea name="notes" rows="4" cols="40"></textarea>
<br />
<input type="submit" value="Send Mail" />
<br />
Free Code at: <a href="http://www.ibdhost.com/contact/">ibdhost.com/contact/</a>
</form>

</body>
</html>


--------------------------------------------------------------------------------


Code for sendeail.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>

<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->

<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;

$todayis = date("l, F j, Y, g:i a") ;

$attn = $attn ;
$subject = $attn;

$notes = stripcslashes($notes);

$message = " $todayis [EST] \n
Attention: $attn \n
Message: $notes \n
From: $visitor ($visitormail)\n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";

$from = "From: $visitormail\r\n";


mail("YourEmail", $subject, $message, $from);

?>

<p align="center">
Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />

Attention: <?php echo $attn ?>
<br />
Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?>

<br /><br />
<a href="contact.php"> Next Page </a>
</p>

</body>
</html>


--------------------------------------------------------------------------------
Note: You MUST modify the YourEmail Address and the link (contact.php)!!!

--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

Safe Mode / Register_globals / Superglobals
How to check that PHP is running and that Safe Mode is OFF !
Use notepad (or other text editor) create an ASCII text file with this line:

<?php phpinfo() ?>

Save that file as test.php
Must be a text file with .php extension - NOT test.php.txt

>Upload test.php (as ASCII file) - to the server

Run test.php from the browser
e.g. www.domain.com/test.php

This will display all the php settings. Use 'find' to check the 'safe' mode section to make sure it is OFF. e.g. look under the Configuration PHP Core Table in the Directive column to see that safe mode is off.

Check that register_globals are on
Use 'find' to check that register_globals are on ! If they need to be turned on - then the settings at your host will determine the method that must be used.

It is difficult to predict the best method for your host, especially if they are not running an apache server. However, if the host is using the latest versions of PHP, it may be best to modify the sendeail.php script by using superglobals

Add this code at the top of sendeail.php:

<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitor = $_POST['visitor'];
$visitormail = $_POST['visitormail'];
$notes = $_POST['notes'];
$attn = $_POST['attn'];
?>

Other possibilities include:

For apache server, add this : php_flag register_globals on to the .htaccess file.
Create a php.ini file with this : register_globals = on; (or similar depending on your host!)
Note 1: A php.ini or a .htaccess file should be in the same directory (or a higher directory) as the script. Both are ASCII (regular text) files that must be unloaded as text files.

Note 2: To check to see if the change worked, recheck test.php (above) and look at the 'local' column to see if register_globals are now on

Note 3: Some web host block the mail() function if the 'fromemail' is not from your domain. In other words: sometimes, the domain email address must be used - or the mail() function will not work.

After i check your server phpinfo, i found that register_globals = off !!!!
how should i do ???
btw, i was using free hosting from trap17.net

 

 

 


Comment/Reply (w/o sign-up)

jlhaslip
This entire topic is a cut and paste from "ibdhost.com/contact/".
Added Quote tags to reverse the credits received and issued a warning.

Comment/Reply (w/o sign-up)

silverkaiser
So can u help me fixed this problem beside give warning only? mad.gif
i need answer !!
i thought this moderator had read my problem, but atualy only know giv warning and no answer reply....
fell frustrated with this moderator...... sad.gif

Comment/Reply (w/o sign-up)

jlhaslip
Due to the possibility of email spamming and the risk of having the trap17.net server banned, the mail function of php is disabled at that server, so there probably is nothing wrong with the script. Trap17.NET does not allow the mail function. Trap17.com allows the mail function, though.

I misunderstood the posting, so I will reverse the warning issued. Sorry.

In the future, post the code from your actual page instead of the Tutorial you used. Several reasons for that. First of all, sometimes there are errors when you copy the code and secondly, it avoids me having to issue the warning in error and reversing it.

Comment/Reply (w/o sign-up)

silverkaiser
smile.gif ok, so i hav no choice others than ask for hosting from trap17.com?
But is it possible to enable mail service for trap17.net at future?
if not possible then i hav to go for trap17.com
laugh.gif Thanks for reply me so fast

Comment/Reply (w/o sign-up)

jlhaslip
Mostly because it is a free and relatively un-supervised service, there is little chance of the mail function being enabled at trap17.net as I understand it.

Comment/Reply (w/o sign-up)

OpaQue
The REGISTER_GLOBALS is off in new versions of PHP. Many developers don't like it and they also create problems in large applications.

Register Globals can be turned ON automatically by adding the following entry into .htaccess file :-

php_flag register_globals on

Register globals can be turned on from .htaccess file which is not accessible at Trap17.net. But At trap17.com, we do give full .htaccess access :-)

Comment/Reply (w/o sign-up)

Vass
I understand this may or maynot be an old topic, but reading it I am alittle confused, is the .com one if you post or if you pay? or what is the go. Sorry just trying to get it worked out in my head.

Comment/Reply (w/o sign-up)

jlhaslip
trap17 dot net is a free web hosting service with an AD Banner
trap17 dot com is a free web hosting service without an AD Banner but requires posting in this Forum to maintain your credits.
computinghost dot com is a paid hosting service which is a partner site.

Comment/Reply (w/o sign-up)

Vass
Thanking you muchly for that clarification. And for that little tutorial, even though it wasn't directed at me, at the top of the page. Would that in theory work for any php hosting place or is that something that requires permissions and trap17 has allowed?

Not that I would use another hosting group, I've heard good things about trap17, however I have friends who are alittle less open to the post-to-host idea.

Comment/Reply (w/o sign-up)



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Pages: 1, 2
Recent Queries:-
  1. mail by vass safe mode - 66.56 hr back. (1)
Similar Topics

Keywords : email, problem, register, globals

  1. Register_globals In Php Setting Need To Be Turned On...
    Installing Efiction and am clueless :S (3)
  2. I Can't Register A New Account!
    HELP! (3)
    I tried to host with Trap 17.net but it said: You can only register 1 account. I've NEVER
    hosted with Trap17 before, at least I don't remember, I really NEED this hosting, and if the
    owner of the site could please delete my previous inactive account. I'll host again and I'll
    stay active with my hosting.....
  3. I Never Got Confirmation Email
    I never got confirmation email (2)
    hi. i regesterd for a website at trap17.net and it said it sent me an email but it didnt. its beeen
    about 7 hours now. and i cant register again cause it says only one account per person. o and trap
    17.net supports php right? thanks....
  4. Email Probs....
    (11)
    Well I tried to register at Trap17.net, but it says only one account per person in the email
    section, even after I create a new email. I'm trying using my email that I use here, and even
    new emails, that I haven't used on here, but still no go. Help please....
  5. Problems: Trap17.net Registration
    activation email (11)
    I have been having problems all day with my forum on orgfree.com, so i went looking around to find
    anouther free host. Well i turned up to be here and registerd under DarkDeath10, took me to the
    activation place and said it sent me an email with the activation.I checked my email and there
    wasn't any email, so i have waited for almost 3 hours now and still haven't gotten the
    activation. I use a yahoo account and i know it blocks a lot of stuff i get. Could it of blocked the
    email? I also tryed to find a way to resend the email, but i couldn't find anything th....
  6. A Prank
    BS account registered under my email (4)
    A person I know tried to register a false account under my email address, intering jibberish for the
    required fields. I would just like to inform the Trap17 staff that this was NOT my doing.....

    1. Looking for email, problem, register, globals

Searching Video's for email, problem, register, globals




advertisement



Email Problem - register_globals = on ?