Jump to content

shortj75

Members
  • Posts

    118
  • Joined

  • Last visited

    Never

Posts posted by shortj75

  1. this is a simple html email i use and it work for me and it works great and really simple

     

    here is the mail form

    mail.php
    
    <form method="post" action="mail2.php">
    <table width=100% height=100% cellspacing=0 cellpadding=5 bgcolor=lightblue valign=top><td>
    To: <input type=text name=to size=30 style="border-width:0px;">
    <br>
    From: <input type=text name=from style="border-width:0px;">
    <br>
    Subject: <input type=text name=sub size=60 style="border-width:0px;"><br>
    <br>
    Messege:<br>
    <textarea name=mess cols=100 rows=20 style="border-width:0px;"></textarea><br>
    <br>
    <input type=submit value=send>
    </td></tr></table></form>

     

    and her is the php code to send it

     

    $to=$_POST['to'];
    $mess=$_POST['mess'];
    $my_subject=$_POST['sub']; 
    $messege="$_POST['mess']"; 
    
    
    
    $my_headers ="MIME-Version: 1.0\r\n"; 
    $my_headers.="Content-type: text/html; charset=iso-8859-1\r\n"; 
    $my_headers.="From: $_POST[from]"; 
    
    
    $mail=mail("$to", "$my_subject", "$messege", "$my_headers"); 
         if(!$mail){
    print "<center>Sorry Your E-mail Was Not Sent</center>";
    }else{
    print "<center>Your E-mail Was Sent Successfuly</center>";
    } 
    
    

    hopefully this helps and if it doesnt i am sorry

  2. try this

    $filename="$_POST[title]";

    if (!$handle = fopen($filename, 'a')) {

            echo "Cannot open file ($filename)";

            exit;

      }

     

      if (fwrite($handle, $body) === FALSE) {

          echo "Cannot write to file ($filename)";

          exit;

      }

    that is what i use well close to it i change it a little the file name is the full path on my server like C:/drive/location i hope this helps

     

     

     

      fclose($handle);

     

     

  3. change table width from <table width='100%' align='center' cellpadding='0' cellspacing='0'> to "<table width='75%' align='center' cellpadding='0' cellspacing='0'> or you could try changing this <td> to <td width=100> or any number you desire and see if that helps

     

     

     

  4. i had the same problem i fixed it by adding a break <br> after my query like this

    $getnum=mysql_query("SELECT * from yourtable");
        while($getnum2=mysql_fetch_array($getnum)){
    echo "$getmun2[tablerow]<br>";
    }
    

  5. did you try to use stripslashes like so

    [code]
    $body = $_POST['body'];


    $body = stripslashes($body);
    [/code]

    that should remove the //////
    but i did notice that you are useing addslashes($body) that will add the ///////  so change addslashes to stripslashes and that should solve your problem
  6. your host probably means to do it by haveing you maile go through a different mail host like yahoo or something like so

    [code]

    <?php


    $from = "who from <from@therehost.com>";
    $to = "you<you@yourhost.com>";
    $subject = "whats up";
    $body = "nothing and you";

    $host = "smtp.host.com"; //(like smtp.yahoo.com)or msn or who ever you user for your email address
    $username = "your_username";(example: killer)
    $password = "your_password";(example: dog or ****)

    $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>");
    }
    [/code]

    or something along that line this code might or might not work for you but some one else may have one that will work better for what you need
  7. if the script i posted workes you may want to try to declair your varibles like so

    [code]
    $to = "myid@mydomain.com";
    $sub = "Testing..1..2..3..4";
    $mess = "Just testing...";
    $from ="From: $_POST[email]";
    [/code]

    instead of

    [code]
    $mail=new My_Smtp_Mail();
    $mail->smtp_host=''; //i tried with localhost and also with the smtp server name my hostingsite provided to me.. but nothing worked

    $mail->to="myid@mydomain.com";
    $mail->from="anotherid@gmail.com";
    $mail->cc='';
    $mail->bcc='';
    $mail->subject="Testing..1..2..3..4";
    $mail->body="Just testing...";
    $mail->rigorous_email_check=1;
    [/code]

    because your host has register globals off witch is recomended and if that is the case you may have to declair them like so

    $to = $_POST['to'];

    or else they wont work
  8. first try this script it is the form and mail script in one
    this script is set to work with the name simpleemail.php
    so you will want to name this page that ok

    [code]
    //this is so you dont get any notices or warnings
    <? error_reporting(E_ERROR);?>

    <?
    //this is the mail script
    $to = $_POST['to'];
    $sub=$_POST['sub'];
    $mess = $_POST['mess'];
    $from="From: $_POST[email]";


    if(isset($_POST['submit'])){   

        $mail=mail("$to", "$sub", "$mess", "$from");
        if(!$mail){
    print "<center>Sorry Your E-mail Was Not Sent</center>";
    }else{
    print "<center>Your E-mail Was Sent Successfuly</center>";
    }
    }else{
    //and here is the mail form
    print "<form method=post action=simpleemail.php>";
    print "<center><table cellpadding=0 cellspacing=0 class=contacttable><tH class=contacthead><center>Simple E-mail</CENTER>";
    print "<TR><TD>To: <input type=text name=to size=40>";
    print "<TR><TD>From: <input type=text name=email>";
    print "<TR><TD>Subject: <input type=text name=sub size=70>";
    print "<TR><TD>Message:<br />";
    print "<textarea name=mess cols=80 rows=10></textarea><BR />";
    print "<input type=submit name=submit value=send>";
    print "</th></tr></td></table></center></form>";
    }
    ?>

    [/code]

    if this script doesnt work your host either doesnt have a mail server or hasnt enabled it to let there users run scripts from there pages and i know for a fact this script works because i use to use it on my page
  9. try changing this

    [code]

    if($row['postorder'] == "descend") { //Comment Query 1
      $q = 'SELECT * FROM comments ORDER BY Date DESC';
           $r = mysql_query($q) or die(mysql_error());
          
    } elseif($row['postorder'] == "ascend"){ //Comment Query 2
          $q = 'SELECT * FROM comments ORDER BY Date ASC';
           $r = mysql_query($q) or die(mysql_error());
        }

    [/code]

    to this

    [code]

    if($row['postorder'] == "descend") { //Comment Query 1
      $q = 'SELECT * FROM comments ORDER BY Date DESC';
           $r = mysql_query($q) or die(mysql_error());
          
    } else{
    if($row['postorder'] == "ascend"){ //Comment Query 2
          $q = 'SELECT * FROM comments ORDER BY Date ASC';
           $r = mysql_query($q) or die(mysql_error());
        }
    }[/code]

    you forgot to put { after else and with that you would need to add } at the end try that and see if it helps
  10. try something like this
    here is the form
    [code]
    form.php


    <form method=post action=sendemail.php>
    <center><table cellpadding=0 cellspacing=0 class=contacttable><tH class=contacthead><center>Contact</CENTER>
    <TR><TD>From: <input type=text name=email>
    <TR><TD>Subject: <input type=text name=sub size=70>
    <TR><TD>Message:<br />
    <textarea name=mess cols=80 rows=10></textarea><BR />
    <input type=submit name=submit value=send>
    </th></tr></td></table></center></form>

    [/code]

    and here is the page that sends the email

    [code]
    sendemail.php
    <?php
    $to = "freaks@aol.com";
    $sub=$_POST['sub'];
    $mess = $_POST['mess'];
    $from="From: $_POST[email]";

    $mail=mail("$to", "$sub", "$mess", "$from");
        if(!$mail){
    print "<center>Sorry Your E-mail Was Not Sent</center>";
    }else{
    print "<center>Your E-mail Was Sent Successfuly</center>";
    }
    ?>

    [/code]
    this is the cantact form i have on my site and it works great
  11. try calling the variables like this on your add page

    [code]
    $id=$_POST['id'};
    $firstname=$_POST['firstname'];
    $surname=$_POST['surname'];
    $email=$_POST['email'];
    $password=$_POST['password'];

    $query=mysql_query("INSERT INTO users (id, firstname, surname, email, password) VALUES('$id', '$firstname', '$surname' , '$email' , '$password' ) ");
    mysql_query($query)or die(mysql_error());
    [/code]

    you have to do it that way because since php4 superglobals are automaticly turned of in your php.ini
  12. try somethin like this i have xp and this code works for me
    [code]
    $filename="c:\temp\pic.gif";

       if (!$handle = fopen($filename, 'r')) {
             echo "Cannot open file ($filename)";
             exit;
       }

    [/code]



  13. i apsolutley agee with crayon violent you got in way over you head php is a fairly simple codeing languagebut it takes a while to learn i have been coding in php/mysql for over a year and a half and i still dont know everything and for what you are asking to write it will take an really experienced coder at least a couple of days to write and get all the bugs out it may take longer unless they already have a script that resembles what you are looking for my suggestion to you is go through as many php tutorials that you can and and find some codes to download and fool around with them to learn php but it is gonna take a while and if you download someone elses code make sure it does not have a copywrite and if it does get the copywrite owners permission before you change it you can go to my site and download any script you want and change it i give everyone permission to do so there is a link to my downloads page in my signiture
  14. this wont work to call your db

    [code]
    mysql_connect("localhost", "user", "pass", "DB_name");
    [/code]
    all mysql_connect will log you in
    to select a db you have to do something like this
    [code]
    $conn=mysql_connect("localhost", "userid", "password");
    if(!mysql_select_db("dbname",$conn))
        die("No database selected.");
    [/code]

  15. try changing this

    [code]
    if (strlen($rec5) >= 1) {
        echo "<img src=/records/images/$rec1.jpg width=40 heigth=40>".$rec1."\n".duration($time)."\n". $rec4.date("m/d/Y", $rec14)."\n"."at"."\n".date("h:ma T", $rec14)."<br>";
        }          
        if (strlen($rec5) >= 3) {
        echo "<img src=/records/images/$rec5.jpg width=40 heigth=40>".$rec5."\n".duration($time1)."\n". $rec7.date("m/d/Y", $rec15)."\n"."at"."\n".date("h:ma T", $rec15)."<br>";
        }
        if (strlen($rec8) >= 3) {
        echo "<img src=/records/images/$rec8.jpg width=40 heigth=40>".$rec8."\n".duration($time2)."\n". $rec10.date("m/d/Y", $rec16)."\n"."at"."\n".date("h:ma T", $rec16)."<br>";
        }
        if (strlen($rec11) >= 3) {
        echo "<img src=/records/images/$rec11.jpg width=40 heigth=40>".$rec11."\n".duration($time3)."\n".$rec13.date("m/d/Y", $rec17)."\n"."at"."\n".date("h:ma T", $rec17)."<br>";
        }
           }
    [/code]

    to this

    [code]

    if (strlen($rec5) > 1) {
        echo "<img src=/records/images/$rec1.jpg width=40 heigth=40>".$rec1."\n".duration($time)."\n". $rec4.date("m/d/Y", $rec14)."\n"."at"."\n".date("h:ma T", $rec14)."<br>";
        }          
        if (strlen($rec5) > 3) {
        echo "<img src=/records/images/$rec5.jpg width=40 heigth=40>".$rec5."\n".duration($time1)."\n". $rec7.date("m/d/Y", $rec15)."\n"."at"."\n".date("h:ma T", $rec15)."<br>";
        }
        if (strlen($rec8) > 3) {
        echo "<img src=/records/images/$rec8.jpg width=40 heigth=40>".$rec8."\n".duration($time2)."\n". $rec10.date("m/d/Y", $rec16)."\n"."at"."\n".date("h:ma T", $rec16)."<br>";
        }
        if (strlen($rec11) > 3) {
        echo "<img src=/records/images/$rec11.jpg width=40 heigth=40>".$rec11."\n".duration($time3)."\n".$rec13.date("m/d/Y", $rec17)."\n"."at"."\n".date("h:ma T", $rec17)."<br>";
        }
           }
    [/code]

    when i was a noob to php i did almos the same thing but i was calling from a db mine looked like this if($getname['user'] <=1){ echo"user doesnt exist";} and at first it didnt work so i removed the = and then it worked fine but it took me about four days of trying different things to figure that out sorry for the story but i thought it might help
  16. there is a very simple salution here is what i do create a page and name it word .php and heres the code you will need

    [code]
    word.php

    <?php
    function Smiley($texttoreplace)
    {
        $smilies=array(
        
    //example: "swearword"=>"what you would like to display on your page";  
    "fuc*"=>"*$#@",
    "shi@"=>"&%$@",
    "as*"=>"*%$",
    //and so on just add the words you want and change fuc* shi@ and as* to the real words

        );

        $texttoreplace=str_replace(array_keys($smilies), array_values($smilies), $texttoreplace);
        return $texttoreplace;
    }
    ?>
    [/code]

    and on your output page test.php place the folowing

    [code]
    test.php
    <?
    include 'word.php';
    your code here
    echo smiley($par2);
    ?>
    [/code]

    i use this script to do the opposite for dirty word on this page [a href=\"http://tfws.dynu.com/joeleinegray/\" target=\"_blank\"]CLICK HERE[/a] when you type in a swear word it say a sentence back to you
×
×
  • 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.