• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Insecure

#1
Rabbit, can you explain to me why you think I don't know anything about PHP?  Or are you simply stating that I don't know anything about that script?  If you are saying I don't know anything about that script you would be a genius.  Want to know why?  ... Well it might be because I openly admitted to finding the source on a website?  I have seen, I believe it was Invert state on this forum a couple times along with others (sorry if it wasn't him exactly...) "Why reinvent the wheel?"  Why do I HAVE to create something that is already out there?

If your simply just stating why ask questions unless I know the script.  Well, I know it enough to get it working, somewhat.  But why would I have a question if I knew the answer already?  In your logic there would be no room to "learn", because there would be no room to ask questions.

So, why are you criticizing me for asking a question?
#2
How the hell are you going to tell me that I don't know PHP?  I have only been working with it for years?  You need to keep your mouth shut when you don't know what your talking about.  Quiz me on any part of the code and I will respond when I get home  from work....
#3
Um... expect I know whats going on.  Its doing what I did a search for... its sending an email WITH an attachment, which there isn't a whole lot of documentation on.  I changed the source just enough to list the variables in there instead of the information being built in.   And the reason I used the source... and trust me I am around here a enough just don't post very often is because and I quote some people on the forums.  "Why reinvent the wheel."  And I do believe the question was does anyone have a solution, not have a comment to make w/o giving any ideas.  I'm sorry but there is no reason to say something unless your willing to help.

Not to mention the documentation on the source isn't that bad.  Its pretty decent to understand and my problem doesn't lie with the source ... it lies in the fact that I can't use the source in anything but a php file that you must view in the browser to get it to work, which doesn't make sense to me.
#4
I have a question that is bugging the crap out of me.  I found a source on php.net about sending emails with attachments.  I got it to work just fine and had no problems with it when I go to the file on my web server.


<?php

require_once 'vars.php';

//create a boundary string. It must be unique
//so we use the MD5 algorithm to generate a random hash
$random_hash md5(date('r'time()));
//define the headers we want passed. Note that they are separated with \r\n
$headers "From: $from\r\nReply-To: $from";
//add boundary string and mime type specification
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
//read the atachment file contents into a string,
//encode it with MIME base64,
//and split it into smaller chunks
$attachment chunk_split(base64_encode(file_get_contents($attachment)));
//define the body of the message.
ob_start(); //Turn on output buffering
?>

--PHP-mixed-<?php echo $random_hash?>
Content-Type: multipart/alternative; boundary="PHP-alt-<?php echo $random_hash?>"

--PHP-alt-<?php echo $random_hash?>
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<?php echo $message?>

--PHP-alt-<?php echo $random_hash?>
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

<?php echo $message?>

--PHP-alt-<?php echo $random_hash?>--

--PHP-mixed-<?php echo $random_hash?>
Content-Type: application/txt; name=<?php echo $saveas?>
Content-Transfer-Encoding: base64
Content-Disposition: attachment

<?php echo $attachment?>
--PHP-mixed-<?php echo $random_hash?>--

<?php
//copy current buffer contents into $message variable and delete current output buffer
$message ob_get_clean();
//send the email
$mail_sent = @mail($to$subject$message$headers);
//if the message is sent successfully print "Mail sent". Otherwise print "Mail failed"
echo $mail_sent "Mail sent" "Mail failed";
?>



BUT if I have an include or require or I put it inside a function and try calling the function or I include it in the current function... It doesn't work and it tells me mail failed.


function addtoFile() {
  $myFile = "./list/test.txt";
  $fh = fopen($myFile, 'w') or die("can't open file");

   $query = mysql_query("SELECT * FROM catrequest WHERE new = '1' ORDER BY lastname ASC, firstname");
    while($row = mysql_fetch_array($query)) {
     $stringData = $stringData . $row['lastname'] . ',' . $row['firstname'] . ',' . $row['address1'] . ',' . $row['address2'] . ',' . $row['city'] . ',' . $row['state'] . ',' . $row['zip'] . "
";
    }
    fwrite($fh, $stringData);
    include("./email.php");
}



EDIT to include vars.php.


<?php

/* Global Database Variables */
 
$db_host   'localhost';     // Database Server //
 
$db_name   'cia_****';   // Database Name //
 
$db_user   'cia_****';   // Database Username //
 
$db_pass   '****';       // Database Password //
/* ENDS Global Database Variables */


/* Global Email Variables */
 
$to '[email protected]'//define the receiver of the email
 
$from '[email protected]';
 
$subject 'Test email with attachment'//define the subject of the email
 
$message '<h2>Hello Jon!</h2><p>This is something with <b>HTML</b> formatting and an <b>attachment</b></p>';
 
$attachment './list/test.txt';
 
$saveas 'mailinglist.txt';
/* ENDS Global Email Variables */

/* Global Catalog Variables */
 
$minbatchnum 0;
/* ENDS Global Catalog Variables */
?>



Does anyone have any ideas what would cause this and possibly a solution to fix it?  As you can probably tell the main reason I would like this to work w/o having to go to the page myself would be because I would like the auto mailer to be Automatic.

Also, I have tried setting up a pipeline in Cpanel 11 and sending an email to a specific account and having it pipeline to the file and that doesn't seem to work as I don't get an email that way.

Thank you for any possible help.
#5
Spht's Forum / Need to register Webbot
October 30, 2006, 11:51 PM
You said we could post this and it should be good.

(11:50 PM) Logged on to WebChannel account ClaneF!
#6
Wow I didn't know that many people lived in wisconsin with me... stealth you need to hit me up when I can drive out there yet...I got my new car (6th one this month) and I want to take a roady hit me up on aim or on my mobile phone when you get a chance!
#7
The best place to start is not with all that crap... start by reading BOOKS.  There are lots of books.  Go to the library or get an e-book and READ READ READ... as much as you might not want to they help a great deal.

Ask LivedKradd he use to tell me the same thing and finally I did and it works a great deal!
#8
General Discussion / Re: 4/20 :-o
April 21, 2005, 10:08 AM
Like steven just said.  Everyone smokes but on 4/20 people smoke a lot more.

Kind of ironic though.  I smoke everyday and yesterday I only hit my bowl 2 times:(.  I went to sleep at 3:30 and slept till this morning at 8:00 and had to go to school:(!  I was so mad!  Oh well that is what stupid parents make you do when you fight ... go run in your room and sleep!
#9
Web Development / Re: PHP Counter
April 14, 2005, 11:03 AM
Craz I have a webserver that I own if you want I can help you out...
PM me
   or
AIM me

Suicidal SnIp3r
#10
If you posted this on the vb section you might get more responces but...

As far as I know for a listbox to remove it you need to que.remove (i).

(If I am wrong I am sorry...pain pills are fun to have because I can't remember much)
#11
Battle.net Bot Development / Re:Adding to DB
May 16, 2004, 11:14 AM
ok;)
#12
Battle.net Bot Development / Re:Adding to DB
May 16, 2004, 03:11 AM
RESOLVED:)!
#13
Battle.net Bot Development / Re:Adding to DB
May 16, 2004, 01:17 AM
I need something in vb:(!
#14
Battle.net Bot Development / Re:Adding to DB
May 16, 2004, 12:54 AM
Quote from: DarkMinion on May 16, 2004, 12:51 AM
IMO, it's bad to store flags as a string...
imo? and what do you sugest?
#15
Battle.net Bot Development / Adding to DB
May 16, 2004, 12:46 AM
[EDIT] RESOLVED!