Jump to content

pranshu82202

Members
  • Posts

    125
  • Joined

  • Last visited

    Never

Posts posted by pranshu82202

  1. Man that was great ... that was awesome....

     

    Can i do all that stuff with php...

     

    I badly want to make such thing....

     

    I googled it and i closed it with empty hands....

     

    I need your help to do all this

     

    Thanxxx

    Waiting for your reply

     

  2. Now a days i m in my college and Today i came across withe something really interesting.

     

    In my college i use internet on a proxy server on which all social networking sites are blocked...

     

    And today i got a site http://www.hidemyass.com which bypass all  the sites and i am able to do my work on twitter and facebook..

     

    But i am Confused, how these sites work.. ????

     

    Can you guyzz tell me what is the working mechanism of theese kind of the sites ...

     

    And tell me is it possible to create something like this in php...

  3. Try my working code :

     

    
    $username = $_POST['admin_name']; 
    $userpass = $_POST['admin_pass'];
    $username = stripslashes($username); 
    $userpass = stripslashes($userpass);
    $username = mysql_real_escape_string($username);  // SQL injection HEALED
    $userpass = mysql_real_escape_string($userpass);  // SQL injection HEALED 
    $sql = "select * from admin where username='$username' and password='$userpass'"; 
    $result=mysql_query($sql);
    
    $count=mysql_num_rows($result);
    if($count==1){
    session_start();
    // register session for as many variables as you want
    
    session_register("admin_name");
    session_register("admin_pass"); 
    header("location:members.php");
    }
    else {
    include "adminlogin.php";
    echo "<br>";
    echo '<center>'."Wrong Username or Password".'</center>';
    }
    

     

    ANd keep HTML and PHP code on separate files.

  4. I am trying to create a mail script to send mails via gmail on my localhost. But every time i get the following error :

     

    SMTP Error: Could not connect to SMTP host. Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.

     

    Here is my code :

     

    <?php
    require("class.phpmailer.php"); // path to the PHPMailer class
    
    $mail = new PHPMailer();  
    
    $mail->IsSMTP();  // telling the class to use SMTP
    $mail->Mailer = "smtp";
    $mail->Host = "ssl://smtp.gmail.com";
    $mail->Port = 465;
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "sender@gmail.com"; // SMTP username
    $mail->Password = "***********"; // SMTP password 
    
    $mail->From     = "sender@gmail.com";
    $mail->AddAddress("reciever@gmail.com");  
    
    $mail->Subject  = "First PHPMailer Message";
    $mail->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
    $mail->WordWrap = 50;  
    
    if(!$mail->Send()) {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $mail->ErrorInfo;
    } else {
    echo 'Message has been sent.';
    }
    ?>
    

     

     

    I am using xampp.

     

    And installed PHPMailer_v5.1 in the htdocs folder.

     

    ANd i have used my gmail username and password in $mail->Username, $mail->Password.

     

    Please heal the issue.

  5. Replace your first four lines :

     

    <?php 
    session_start();
    if (isset($_SESSION["manager"])) {
        header("location: index.php"); 
        exit();
    }
    ?>

     

    With :

     

    <?php 
    session_start();
    if (!isset($_SESSION["manager"])) {
        header("location: index.php"); 
        exit();
    }
    ?>
    

     

    And i think that you have keep the html login page code and php script in the same page, so u need to put your whole php code in the following if statement :

     

    if (isset($submit)){ 
    //whole php code
    }  

     

    Hope it helped..

    Happy Coding

     

  6. Dreamweaver does not show the php code in the design (or split) window... You need to some program like xampp

     

    And then Proceed with the following steps..

     

    1. Download xampp (free) and extraxt the contents to root C:/

     

    2. Open xampp folder and open xampp-control.exe

     

    3. Start apachae and myaql serveics and they shuld turn green.

     

    4. Now go to your browser and type http://localhost and see wether its opening xampp window.

     

    5. If its working then save your .php file in the following directory :

     

                                C:\xampp\htdocs

     

    6. Now again go to your browse and type in your address bar : http://localhost/abc.php  (here abc.php is the name of your file)

     

    And it will work if your php code is fine...

     

    And your second problem :  You can put as many php tag as you can..

     

    For ex.

     

    <html>
    <body>
    
    ....
    
    <?php
    
    // Any Code
    
    ?>
    
    Your HTML Code
    
    <?php
    
    //Your Second code
    
    ?>
    
    </body>
    </html>
    

     

     

    HOPE IT HELPS ...

    Happy CODING

  7. Well i want to store an image file (Or any other like zip etc.) of around 2 MB (or even more) in my mysql database, what should be the column properties for that....

     

    Lonblob is even unsuccessful for this...

     

    Please help.... 

  8. I want to know about upload..

     

    That is what shuld be the column properties of the database table....

     

    And what shuld be the php script...

     

    Please help

  9. <?php  
    
    require("class.phpmailer.php"); // path to the PHPMailer class
    
    $mail = new PHPMailer();  
    
    $mail->IsSMTP();  // telling the class to use SMTP
    $mail->Mailer = "smtp";
    $mail->Host = "ssl://smtp.gmail.com";
    $mail->Port = 465;
    $mail->SMTPAuth = true; // turn on SMTP authentication
    $mail->Username = "yourusername@gmail.com"; // SMTP username
    $mail->Password = "yourpassword"; // SMTP password 
    
    $mail->From     = "email address sender";
    $mail->AddAddress("email address receiver");  
    
    $mail->Subject  = "First PHPMailer Message";
    $mail->Body     = "Hi! \n\n This is my first e-mail sent through PHPMailer.";
    $mail->WordWrap = 50;  
    
    if(!$mail->Send()) {
    echo 'Message was not sent.';
    echo 'Mailer error: ' . $mail->ErrorInfo;
    } else {
    echo 'Message has been sent.';
    }
    ?>

     

     

    I am using this code to send mails via smtp...

     

    But all the time i get the following error

     

    SMTP Error: Could not connect to SMTP host. Message was not sent.Mailer error: SMTP Error: Could not connect to SMTP host.

     

    Please tell me what shuld i do....

  10. When i use this ... its giving an error...

     

    Warning: Cannot modify header information - headers already sent by (output started at /..../...../.......///...) in /...../...../...../abc.php on line 104

  11. I am using this header...

     

    But its showing an error...

     

    <?php
    
    // Some code
    
    header ('location : abc.php?id=echo'.$id.'');
    
    // Some code
    
    ?>
    

     

     

    Can you tell me what shuld i write instead...

     

    Thanks

  12. Is their any method by which i can get browser info of the client side...

     

    I used

     

     $_SERVER['HTTP_USER_AGENT']

     

    but it gives

     

    Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30  - WHEN I USED CHROME

     

    and

     

    Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 - When i used firefox.....

     

    (I just need the browser's name then why its attaching a big string  "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101"  with every name)

×
×
  • 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.