Jump to content

Deoctor

Members
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Deoctor

  1. write a function mail() giving the details which i already gave u can call the mail() at the below code if (dbaction($SQLstmt)) { print("<div id=\"messagecontainer\">\n"); printmessage("Party Room Saved"); print("</div>\n"); mail(); } i hope this will work on by the way one more thing ur server should have the port 25 opened for this to work.. or else it will not send anything
  2. i am sorry for the previous code.. actually the code wil not work.. check the new code.. <?php $dir="./"; $nimg="10"; $itype="jpg"; $rnumb=rand(1,$nimg); echo "<img src=".$dir."".$rnumb.".".$itype.">"; ?> put the image numbers as 1.jpg,2.jpg,3.jpg......10.jpg and place them in the same directory in which this code is there..
  3. use the below code <?php $dir="./"; $nimg="10"; $itype="jpg"; $bor="1"; $rnumb=rand(1,$nimg); echo ""<img src=".$dir."".$rnumb."".$itype." >"; ?> make the necessary changes to ur needs
  4. hai this requires a lot of coding upload the login page code let me try this one..
  5. i think u can write a function mail() over in the savestore.php mail <?php $from_name = "Chaitu"; $from_email = "drvirusindia@gmail.com"; $to_email = "drvirusindia@gmail.com"; $subject = "Hai"; $message = "Hai Chaitu."; $headers = "From: ".$from_name." <".$from_email.">\r\n"; $headers .= "Reply-To: ".$from_email."\r\n"; if(mail($to_email, $subject, $message, $headers, "-f".$from_email)); { echo "Mail Sent!"; } else { echo " Unable to send the mail!"; } ?> here u modify the email address and call the function after u save the records to the table.. check whether the port 21 is opened in ur server.. depending on the server capability the mail may take some time to reach the destined email id
  6. i think at echo '<br><br> u have made a mistake.. close the echo and try it out..
  7. hai i have modified your code some thing like this i think this should work <html> <head></head> <body> <form action='new.php' method='POST'> <!--Username: <input type='text' size='15' maxlength='25' name='fname'>--> <h1>Telephone Directory</h1> <br> <table align='Left'> <tr> <td>LastName</td> <td><input name='LastName' /></td> </tr> <tr> <td>FirstName</td> <td><input name='FirstName' /></td> </tr> <tr> <td>StreetAddress</td> <td><input name='StreetAddress' /></td> </tr> <tr> <td>City</td> <td><input name='City' /></td> </tr> <tr> <td>State</td> <td><input name='State' /></td> </tr> <tr> <td>Zip</td> <td><input name='Zip' /></td> </tr> <tr> <td>AreaCode</td> <td><input name='AreaCode' /></td> </tr> <tr> <td>PhoneNumber</td> <td><input name='PhoneNumber' /></td> </tr> <tr> <td></td> <td><input type="submit" /></td> <td></td> </tr> <td><a href="http://localhost/chaitu/testdir/111.txt">Read file</a></td> </table> </form> </body> </html> name it as use.html and the php file is <?php $lname=$_POST["LastName"]; $fname=$_POST["FirstName"]; $add=$_POST["StreetAddress"]; $file=fopen("111.txt","a+") or exit("Unable to open file!"); /*while(!feof($file)) { echo fgets($file)."<br/>"; }*/ fwrite($file,$lname); <br/> fwrite($file,$fname); <br/> fwrite($file,$add); <br/> fclose($file); echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=use.html\">"; ?> name this as new.php this would write the file and revert back to the use.html file.. now to display the file i have given the href link of the txt file.. u can use as fetch each line and display also I think this would resolve the issue
  8. hai open your php.ini file in the server and check for this option extension=php_curl.dll if it is commented then uncomment it off and i think the curl will work out for you.. to use the curl for an website use the below code to get it out <?php // create a new cURL resource $ch = curl_init(); $demo='http://chaitu09986025424.blog.co.in/feed/rss/'; // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "$demo"); curl_setopt($ch, curlopt_content_type,"text/xml"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLINFO_HEADER_OUT, true); // grab URL and pass it to the browser $data=curl_exec($ch); $info=curl_getinfo($ch); //var_dump(curl_getinfo($ch,CURLINFO_HEADER_OUT)); echo $info['http_code']; print_r("$data"); ?> this should give you the result of the webpage
  9. check with this software to see whether the ports are opened coz still now when i am using telnet for the port 25 on your server it is giving me the same response. http://chaitu09986025424.blog.co.in/2009/11/18/myports-gives-you-detailed-information-on-open-ports/
  10. is this the same server ur are using for sending the mails.?? coz still now it is giving for me as closed only
  11. check with this code whether the server is able to send the mails or not.. <?php $from_name = "Chaitu"; $from_email = "drvirusindia@gmail.com"; $to_email = "drvirusindia@gmail.com"; $subject = "Hai"; $message = "Hai Chaitu."; $headers = "From: ".$from_name." <".$from_email.">\r\n"; $headers .= "Reply-To: ".$from_email."\r\n"; if(mail($to_email, $subject, $message, $headers, "-f".$from_email)); { echo "Mail Sent!"; } else { echo " Unable to send the mail!"; } ?> otherwise if ur using an smtp server to send the mails then check with the below code. <?php require_once "Mail.php"; $from = "Chaitu <drvirusindia@gmail.com>"; $to = "Chaitu <drvirusindia@gmail.com>"; $subject = "Hi!"; $body = "Hi,\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>"); } ?> if the smtp is an autenticated then use this code below.. <?php require_once "Mail.php"; $from = "Chaitu <drvirusindia@gmail.com>"; $to = "Chaitu <drvirusindia@gmail.com>"; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "ssl://mail.example.com"; $port = "465"; $username = "smtp_username"; $password = "smtp_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'port' => $port, '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>"); } ?> i hope these would resolve the error
  12. the server which ur are using for hosting the files www.benaka.in if ur are using any other server to send the files check with that one
  13. hai u checked whether the port 25 or 465 opened or not use the option telnet hostname 25 command to see whether the port is opened or close as i can see from my machine that both of these ports are closed on the server. if u open these then might be it will work on. if you are using some other port on the server to send the mails please check with that port also.. by default the server uses these ports only
  14. boss what is wanted is not to display this in some colors or stuff. how do i pass this one to a variable and scan the result for a particular keyword.. i dont think there is any thing that is related to html in this..
  15. Hai i am using the curl option to validate the site for the rss feed. my code is <?php // create a new cURL resource $ch = curl_init(); $demo='http://chaitu09986025424.blog.co.in/feed/rss/'; // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "http://validator.w3.org/feed/check.cgi?url=$demo"); curl_setopt($ch, CURLOPT_HEADER, false); // grab URL and pass it to the browser curl_exec($ch); echo $info['http_code'] . " " . $http_codes[$info['http_code']]; // close cURL resource, and free up system resources curl_close($ch); ?> now the problem is that how do i read the file and pass the parameters... the result of this would be Congratulations! This is a valid RSS feed. Recommendations This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations. •line 11, column 107: Self reference doesn't match document location [help] ... rel="self" type="application/rss+xml" /> ^Source: http://chaitu09986025424.blog.co.in/feed/rss/ 1.<?xml version="1.0" encoding="UTF-8"?> 2.<rss version="2.0" 3.xmlns:content="http://purl.org/rss/1.0/modules/content/" 4.xmlns:wfw="http://wellformedweb.org/CommentAPI/" 5.xmlns:dc="http://purl.org/dc/elements/1.1/" 6.xmlns:atom="http://www.w3.org/2005/Atom" 7.> 8. 9.<channel> 10.<title>Chaitu's</title> 11.<atom:link href="http://chaitu09986025424.blog.co.in/wp-rss2.php" rel="self" type="application/rss+xml" /> 12.<link>http://chaitu09986025424.blog.co.in</link> 13.<description>Know about the World and gain some Knowledge</description> 14.<pubDate>Fri, 20 Nov 2009 11:18:56 +0000</pubDate> how do i pass the This is a valid RSS feed. data in code so that i can validate the given url.. please some body help me on this..
  16. yes i to agree with the cags.. there is no need for any one to hack the database. it is already available for easy hacking.. please mention ur database details in a separate inc page and include the file in here .. u can use it like this and name it as dbpage.inc <?php $dbhost='localhost'; $dbuser='root'; $dbpass=''; $dbname='rss'; $link=mysql_connect($dbhost,$dbuser,$dbpass); if(!$link) { echo("<p>Could not connect to MySql</p>".mysql_error()); } else { //echo("<p>Connection successful!!!</p>"); } ?> and use the following in the login page include("dbpage.inc");
  17. Hai in the code which you have written u have mentioned as $result = mysql_query("SELECT * from players"); but where are you verifying the values that are given to the values in the database. so u need to change the code like this $result = mysql_query("SELECT * from players where name='$_POST["fname"]' and password=$_POST["ppassword"]");
  18. hai dude have u tried using the cookies i think that would resolve your issue u can use this login which i have created <?php //session_start(); // set your infomation. include("access.php"); if (isset($_COOKIE['user'])) { echo "Welcome $_COOKIE[user]"; }else{ if ($_POST['username']) { //did they supply a password and username $username=$_POST['username']; $password=$_POST['password']; if ($password==NULL) { echo "A password was not supplied"; }else{ $query = mysql_query("SELECT username,password FROM userlogin WHERE username = '$username'") or die(mysql_error()); $data = mysql_fetch_array($query); if($data['password'] != $password) { echo "The supplied login is incorrect"; }else{ $query = mysql_query("SELECT username,password FROM userlogin WHERE username = '$username'") or die(mysql_error()); $row = mysql_fetch_array($query); setcookie("user", "$username", time()+3600); echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=all.html\">"; } } } ?> <form action='login.php' method='POST'> <table align="center" width="300"> <tr> <td height="800"><table style='border:1px solid #000000;' align="center"> <tr> <td align='right'> Username: <input type='text' size='15' maxlength='25' name='username'> </td> </tr> <tr> <td align='right'> Password: <input type='password' size='15' maxlength='25' name='password'> </td> </tr> <tr> <td align='center'> <input type="submit" value="Login"> </td> </tr> <tr> <td align='center'> <a href='register.php'>Register Here</a> </td> </tr> </table></td> </tr> </table> </form> <? }; ?> change it to your needs
  19. change the line if$row[1] == $_POST["fname"]) to this one if$row[1] == $_POST["fname"]
  20. Hai i am building a site for validation of the RSS feeds and adding it in the database. When a user enters a rss web address i need to validate the address and if it contains a rss then i need to enter it into the site or else i need to mention a message.. how do i do it. i think the easy way is to pass the feed address to this address http://validator.w3.org/feed/check.cgi?url= but how can i check what result is it giving.. do any one have an idea or else if u have any validation things available. kindly help me out.. <html> <body> <form action="subscription.php" method="post"> <b>Add New Subscription URL :</b><input name="subscr" value="" size="50"> <input type="submit" name="submit" value="Add" /> </form> </body> </html> <?php //include("login.php"); include("access.php"); mysql_select_db($dbname); if (isset($_COOKIE['user'])) { echo "Welcome $_COOKIE[user]<br>"; $username="$_COOKIE[user]"; //echo "<p>$username</p>"; $query = mysql_query("SELECT email,password FROM userlogin WHERE username = '$username'") or die(mysql_error()); $data = mysql_result($query,0); //echo $data; } else { echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=login.php\">"; } $subscr=$_REQUEST['subscr']; if($subscr) { //url validation if (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $subscr)) { //print "$subscr url OK."; mysql_select_db($dbname); $re=mysql_query("select * from usubs where url='$subscr'"); $rows=mysql_num_rows($re); if($rows==0) { mysql_query("Insert into usubs(email,url) values('$data','$subscr')"); //echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=all.html\">"; } else { echo "The $subscr url already exists with your login"; //echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=subscription.php\">"; } } else { print "$subscr url not valid!"; } } else { //echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"1; URL=subscription.php\">"; //echo("$subscr"); } ?> this is my code presently i am using the regular expression of the website address but how do i use it to verify the rss feed address.. as the present one is validating the www.google.com also as a valid feed..
  21. Hai i have resolved the issue myself.. after changing the code to this one. it is displaying the required one. Thank you all for your help.. <?php $dir = "./clock/"; $arr_file_names = array(1=>'1.html','2.html','3.html','4.html','5.html','6.html','7.html','8.html','9.html','10.html'); $number_of_html_files = count($arr_file_names); $rnumb = ceil(rand(1,$number_of_html_files)); //echo $dir."clock".$arr_file_names[$rnumb]; include("$dir".clock."$arr_file_names[$rnumb]"); //echo "<a href=".$dir."clock".$arr_file_names[$rnumb].">$arr_file_names[$rnumb]</a>"; ?>
  22. Hai I have some html files and i would like to display them in a random manner using the php. can any one help me out..I have been trying this one.. but it is not working.. <?php $dir="./clock/"; $nimg="10"; $itype="html"; $rnumb=rand(1,$nimg); echo "<a href=".$dir."clock".$rnumb.".".$itype."></a>"; ?>
  23. Hai Thank you for your help. I have finally done it out i need to change my code the little bit when the echo command has been changed like this it is displaying correctly echo ("<br><a href = 'note.php?rss=$url'target='frame3'>$url</a>");
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.