-
Posts
663 -
Joined
-
Last visited
Everything posted by Deoctor
-
can u post the entire code of urs... not the parts
-
Trying to create call logging system - need number generator
Deoctor replied to leachus2002's topic in PHP Coding Help
sorry to tell u but i cannot understand what u are asking.. if u want to check the rand number <?php for ($i=1;$i<=1000;$i++) { $arr = range('a','z'); $arr1=range('',''); shuffle($arr); echo implode("", $arr);echo "<br>"; } ?> the odds of getting the same value are astronomical in this one... -
Website being hacked! Some one is deleting all posts!
Deoctor replied to runnerjp's topic in PHP Coding Help
so u are using the admin login only to delete the posts right, so what u can do is check the http referrer from which they are using to access the pages of deletion. if any script is doing it out then obviously u can restrict that.. check with these server variables and add the ones which ever u need most http://php.net/manual/en/reserved.variables.server.php -
Website being hacked! Some one is deleting all posts!
Deoctor replied to runnerjp's topic in PHP Coding Help
if u can provide us ur code then i can surely help u out on hw u can log the details of the guys who are doing in out.. i mean this one onlyy.. whether u are storing any thing when some one is doing something on ur site... this would slow down ur process but it will surely help u out when something like this happens... -
Website being hacked! Some one is deleting all posts!
Deoctor replied to runnerjp's topic in PHP Coding Help
havent u made any kind of logs in ur code.. can u provide me with the code details -
dude is this ur form completely..?? if yes then your are in serious trouble.. even if no ones enters anything in the form and click on send it will send mails to you.. this is the reason u are getting blank mails... r u checking some where abt the blank fields..?? paste the entire code so that we can help you out.
-
Website being hacked! Some one is deleting all posts!
Deoctor replied to runnerjp's topic in PHP Coding Help
can u provide access to this and let us see it .. -
change ur date function like this and try it on ur local machine..by changing the date of the system.. $dateto=strtotime(date("Y-m-d"));
-
hai i dont see any difference, i am getting the correct results when i run the same code.. are u sure u have deleted ur cookies from the browser and run the code..
-
here i am checking for the file type $uploaded_type=strtolower(substr($_FILES['uploaded']['name'],strrpos($_FILES['uploaded']['name'],'.')+1)); and here i am comparing the type.. if($uploaded_type==$row['type_name']) the file size is here i am checking out.. <input type="hidden" name="MAX_FILE_SIZE" value="9999999999999999" />
-
just u check these basic things first for that domain telnet <host name> 21 if this shows some error then that host cannot send mails ordinarily. if u are using an smtp server check whether the smtp server has any ip restrictions placed.
-
trying to create image using php coding for capcha
Deoctor replied to piyush23424's topic in PHP Coding Help
oops I forgot that check this here <?php session_start(); $width = 120; $height = 40; $length = 5; $baseList = '0123456789abcdfghjkmnpqrstvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $code = ""; $counter = 0; $image = @imagecreate($width, $height) or die('Cannot initialize GD!'); for( $i=0; $i<10; $i++ ) { imageline($image, mt_rand(0,$width), mt_rand(0,$height), mt_rand(0,$width), mt_rand(0,$height), imagecolorallocate($image, mt_rand(150,255), mt_rand(150,255), mt_rand(150,255))); } for( $i=0, $x=0; $i<$length; $i++ ) { $actChar = substr($baseList, rand(0, strlen($baseList)-1), 1); $x += 10 + mt_rand(0,10); imagechar($image, mt_rand(3,5), $x, mt_rand(5,20), $actChar, imagecolorallocate($image, mt_rand(0,155), mt_rand(0,155), mt_rand(0,155))); $code .= strtolower($actChar); } header('Content-Type: image/jpeg'); imagejpeg($image); imagedestroy($image); $_SESSION['securityCode'] = $code; ?> -
yes it is using the sendmail of ur server instead of the smtp settings..
-
trying to create image using php coding for capcha
Deoctor replied to piyush23424's topic in PHP Coding Help
try this one <?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html> <head> <title>MicroCaptcha</title> <link href="style/style.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="main"> <div class="caption">CAPTCHA</div> <div id="icon"> </div> <?php if (isset($_POST['submitBtn'])){ $secCode = isset($_POST['secCode']) ? strtolower($_POST['secCode']) : ""; if ($secCode == $_SESSION['securityCode']) { echo "<p>The result code was valid!<br/></p>"; echo "<p><a href=\"".$_SERVER['PHP_SELF']."\">Repeat the test!</a><br/><br/></p>"; unset($_SESSION['securityCode']); $result = true; } else { echo "<p>Sorry the security code is invalid! Please try it again!</p>"; $result = false; } } if ((!isset($_POST['submitBtn'])) || (!$result)){ ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" > <table width="400"> <tr><td>Security code: <input class="text" name="secCode" type="text" size="10" /></td> <td><img src="securityCode.php" alt="security code" border="1" /></td> </tr> <tr><td colspan="2" align="center"><br/><input class="text" type="submit" name="submitBtn" value="Send" /></td></tr> </table> </form> <?php } ?> </div> </body> and use code tags when ever u paste the code.. -
try this <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?>
-
trying to create image using php coding for capcha
Deoctor replied to piyush23424's topic in PHP Coding Help
so wt is wrong. and try using the -
if in ur php.ini the sendmail path is already configured then try using the program to send it through sendmail only.. by the way what hosting ur using up..
-
<!-- send mail using an smtp--> <?php require_once "Mail.php"; $from = "test@tets.com"; $to = "mail@someone.com"; $subject = "Hi!"; $body = "<h1>Hi</h1>,\n\nHow are you?"; $host = "mail.example.com"; $username = "smtp_username"; $password = "smtp_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("<p>" . $mail->getMessage() . "</p>"); } else { echo("<p>Message successfully sent!</p>"); } ?> try with this
-
if/else trying to verify correct email format
Deoctor replied to enhanced08's topic in PHP Coding Help
this $query="SELECT * FROM mailing_list WHERE email='$email'"; $result=mysql_query($query); if($result=='$email') { should be of some thing like this $query=mysql_query("SELECT email FROM mailing_list WHERE email='$email'"); $result=mysql_result($query,0); if($result=='$email') { for email validation u can check it by this method too. <script language = "Javascript"> function echeck(str) { var at="@" var dot="." var lat=str.indexOf(at) var lstr=str.length var ldot=str.indexOf(dot) if (str.indexOf(at)==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){ alert("Invalid E-mail ID") return false } if (str.indexOf(at,(lat+1))!=-1){ alert("Invalid E-mail ID") return false } if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){ alert("Invalid E-mail ID") return false } if (str.indexOf(dot,(lat+2))==-1){ alert("Invalid E-mail ID") return false } if (str.indexOf(" ")!=-1){ alert("Invalid E-mail ID") return false } return true } function ValidateForm(){ var emailID=document.frmSample.txtEmail if ((emailID.value==null)||(emailID.value=="")){ alert("Please Enter your Email ID") emailID.focus() return false } if (echeck(emailID.value)==false){ emailID.value="" emailID.focus() return false } return true } </script> <form name="frmSample" method="post" action="#" onSubmit="return ValidateForm()"> <p>Enter an Email Address : <input type="text" name="txtEmail"> </p> <p> <input type="submit" name="Submit" value="Submit"> </p> </form> -
check whether u are able to connect to the database.. change require_once to require also try using error_reporting(0) in the beginning of the page.. to get errors
-
add these for the headers.. $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; and make sure u have the mime installed in php
-
Please help --- PHP unsubscribe to a newsletter - no database
Deoctor replied to maros174's topic in PHP Coding Help
then u can do some thing like this.. give a link at the bottom of the page. in that page u just give one small input box and store these values in the file. like the same exact code which u are doing out for subscription. but change the file name to unsubscribe.txt. like the code which is provided by the182guy thatz it -
Please help --- PHP unsubscribe to a newsletter - no database
Deoctor replied to maros174's topic in PHP Coding Help
so do u send this entire message to the subscribers. if yes how are u doing it out..i mean any code which u are using out -
in mysql 4.0.-- u cannot run child queries under a single line. some thing like select * from table1 where email=(select email from table2 where some condition) where as in the mysql version >=5 u can do it out.. so like this some of the queries that run in one version will differ from other version.. like wise in php too some functions might been deprecated in one version and also u might not have enabled that one in ur php.ini file.. so this could be the basic difference.. so when ever u get an error check for the version of the php and check for the related item whether they are activated in ur ini file
-
Please help --- PHP unsubscribe to a newsletter - no database
Deoctor replied to maros174's topic in PHP Coding Help
Thanks, that is exactly what I wanted to do.... The regulator insists that the newsletters in my country contain only the link on which a user clicks and automatically unsubscribe from the newsletter. ...but I don't know how to append the address to the url, how do I get it and put it into a variable? in the code where u are sending the newsletters u can do that appending of the email address.. so while sending the newsletter to a particular email id the unsubscribe link will be with his email id. this way u can do it out