REQ: Help with php code...

Status
Not open for further replies.

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
Well i have this www.collide.elementfx.com/dmailer.php

And i have this layout

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>dMAiLER</title>
<style type="text/css">BODY             
{
   background-color:#336699;
   font-size: 11px;
   font-family: Verdana, Arial;
   color: #000;
   margin: 20px;
   padding: 0px;
}

h1 { font-family:arial,verdana,sans-serif;font-weight:bold;font-size:30px;color:#000; border-bottom:1px solid #000; }
h2 { font-family:arial,verdana,sans-serif;font-weight:bold;font-size:20px;color:#000; }
TABLE, TR, TD     { font-family:Verdana, Arial;font-size: 11px; color:#000 }
a:link, a:visited, a:active  { color:#000055 }
a:hover                      { color:#333377;text-decoration:underline }
.centerbox { margin-right:10%;margin-left:10%;text-align:left }
.warnbox {
    border:1px solid #F00;
    background: #FFE0E0;
    padding:6px;
    margin-right:10%;margin-left:10%;text-align:left;
  }
.tablepad    { background-color:#F5F9FD;padding:6px }
.pformstrip { background-color: #D1DCEB; color:#3A4F6C;font-weight:bold;padding:7px;margin-top:1px;text-align:left }
.pformleftw { background-color: #F5F9FD; padding:6px; margin-top:1px;width:40%; border-top:1px solid #C2CFDF; border-right:1px solid #C2CFDF; }
.pformright { background-color: #F5F9FD; padding:6px; margin-top:1px;border-top:1px solid #C2CFDF; }
.tableborder { border:1px solid #345487;background-color:#FFF; padding:0px; margin:0px; width:100% }

#copy { font-size:10px }
       
#button   { background-color: #4C77B6; color: #FFFFFF; font-family:Verdana, Arial; font-size:11px }
#textinput { background-color: #EEEEEE; color:Ã￾#000000; font-family:Verdana, Arial; font-size:10px; width:100% }
#dropdown { background-color: #EEEEEE; color:Ã￾#000000; font-family:Verdana, Arial; font-size:10px }
#multitext { background-color: #EEEEEE; color:Ã￾#000000; font-family:Courier, Verdana, Arial; font-size:10px }
#logostrip {
   padding: 0px;
   margin: 0px;
   background: #7AA3D0;
    }</style>
</head>
<body>
<table style="border-right: #000 1px solid; border-top: #000 1px solid; border-left: #000 1px solid; border-bottom: #000 1px solid;" cellspacing="0" cellpadding="15" width="750" align="center" bgcolor="#fffff0">
<tbody>
<tr>
<td align="left">
<h1>Welcome to The dMailer</h1>(C) DEREK C</td></tr></tbody></table>
<br><a name="changes"></a> 
<table style="border-right: #000 1px solid; border-top: #000 1px solid; border-left: #000 1px solid; border-bottom: #000 1px solid;" cellspacing="0" cellpadding="15" width="750" align="center" bgcolor="#fffff0">
<tbody>
<tr>
<td align="left">
<h2><?php
   if ($_POST['submit']) {
      $header = 'From: '. $_POST['from'];
      mail($_POST['to'], $_POST['subject'], $_POST['body'], $header);
      echo 'Thank you! Your email has been sent and your ip <!--#echo var="REMOTE_ADDR" --> has been logged and stored. =) Have fun Dont jack my work...';
   }
?>
 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
  
<div>
   To:        <input type="text" name="to" value="">
<br>
   Subject: <input type="text" name="subject" value="" />
<br>
   Message: <textarea name="body"></textarea>
<br>
   From:      <input type="text" name="from" value="">
<br>
Enter Code: <img src="captcha.php"><input type="text" name="vercode" /><br>
   <input type="submit" name="submit" value="Send dMAiL">
  </div>
 </form> </div></form></h2></td></tr></tbody></table>
<br>
<table style="border-right: #000 1px solid; border-top: #000 1px solid; border-left: #000 1px solid; border-bottom: #000 1px solid;" cellspacing="0" cellpadding="15" width="750" align="center" bgcolor="#fffff0">
<tbody>
<tr>
<td align="left">
<h2>Please Do not JOCK My work... (C) DEREK CHAI 
<br></h2>
<ul>&nbsp;</ul></td></tr></tbody></table>
</body>
</html>

i have
Code:
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">

That aready there...

I want to add
Code:
<form action="submit.php" method="post">
So that it verifys becuase it isnt verfiying can someone modify my layout to make it work like the codes in it...
http://www.phpjabbers.com/phpexample.php << that is the tut
 
Last edited:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
2, i mean 3 things:

1. Weird requests you're having...
2. 404 on link
3. Verify?! Mean check that security code?

Just change PHP part where form is submited:

PHP:
<?
if ($_POST['submit']) {
   if ($_POST['vercode'] == $_SESSION['code']) // Change $_SESSION['code'] to what stores the code
      $header = 'From: '. $_POST['from'];
      mail($_POST['to'], $_POST['subject'], $_POST['body'], $header);
      echo 'Thank you! Your email has been sent and your ip <!--#echo var="REMOTE_ADDR" --> has been logged and stored. =) Have fun Dont jack my work...';
   }
   else // If code is wrong
   {
      echo 'Sorry, you entered wrong security code. Please try again.';
   }
}
?>
4. (so, theres 4!)
PHP:
echo 'Thank you! Your email has been sent and your ip <!--#echo var="REMOTE_ADDR" --> ';
Sorry, that doesn't work, buddy!

To print IP in text:
PHP:
echo 'Thank you! Your email has been sent and your ip '. $_SERVER['REMOTE_ADDR'] .' has been logged and stored. =) Have fun Dont jack my work...';
To print IP in comment:
PHP:
echo 'Thank you! Your email has been sent and your ip <!-- '. $_SERVER['REMOTE_ADDR'] .' --> has been logged and stored. =) Have fun Dont jack my work...';
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
Link fixed... Please look now Like when you register for IPB it uses a image verfication i want that to work in mine so to prevent spam bots also the links now fixed
 
Last edited:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Even in that page is that written! (how)

PHP:
  <?
  session_start(); 
  if ($_POST["vercode"]  != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')  {
       echo  '<strong>Incorrect verification code.</strong><br>';
  } else {
      $header = 'From: '. $_POST['from'];
      mail($_POST['to'], $_POST['subject'], $_POST['body'], $header);
      echo 'Thank you! Your email has been sent and your ip '. $_SERVER['REMOTE_ADDR'] .' has been logged and stored. =) Have fun Dont jack my work...';  
  };
?>

Put it where form sending is.
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
Remove session_start(); from the check and put in FIRST line:

PHP:
<?
session_start();
?>

EDIT: Actually change whole checking code to this:

PHP:
<?
if ($_POST['submit'] && $_POST["vercode"]  != $_SESSION["vercode"] OR $_SESSION["vercode"]=='')  {
     echo  '<strong>Incorrect verification code.</strong><br>';
} else {
    $header = 'From: '. $_POST['from'];
    mail($_POST['to'], $_POST['subject'], $_POST['body'], $header);
    echo 'Thank you! Your email has been sent and your ip '. $_SERVER['REMOTE_ADDR'] .' has been logged and stored. =) Have fun Dont jack my work...';  
};
?>

And make sure that you put session_start to first lines.
 
Last edited:

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
http://collide.elementfx.com/dmail3.php

It works BUT how do i put the incorrect verfication not redirecting to another page..

Also if you would try it it says good verfication BUT it doesnt send the mail..
 
Last edited:

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
http://collide.elementfx.com/dmail3.php

It works BUT how do i put the incorrect verfication not redirecting to another page..
I would really like it if you would put it in simple English.

Also if you would try it it says good verfication BUT it doesnt send the mail.
It sends for me

Besides all italics, i found something also:

HTML:
<h2Thank you! Your email has been sent and your ip 217.159.199.248 has been logged and stored. =) Have fun Dont jack my work...
<form action="/dmail3.php" method="post">
 <form action="submit.php" method="post">
<div>
   To:        <input type="text" name="to" value="">
<br>
   Subject: <input type="text" name="subject" value="" />
<br>
   Message: <textarea name="body"></textarea>
<br>
   From:      <input type="text" name="from" value="">
<br>
Enter Code: <img src="captcha.php"><input type="text" name="vercode" /><br>
   <input type="submit" name="submit" value="Send dMAiL">
  </div>
 </form> </div></form></h2>

Might wanna post whole PHP?
 

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
Uh its the same thing i posted... (the html code)
 

t2t2t

New Member
Messages
690
Reaction score
0
Points
0
I don't think its 1on1 same, because of changes to code.

You might have some faulty coding.

EDIT: 300th post (including sustained server application)
 
Last edited:

Derek

Community Support Force
Community Support
Messages
12,882
Reaction score
186
Points
63
Hmm ill send you the html later im busy now..
 
Status
Not open for further replies.
Top