Jump to content

drisate

Members
  • Posts

    805
  • Joined

  • Last visited

Everything posted by drisate

  1. The way you merged your PHP function into your HTML was so wrong you gave the impression it was a JavaScript function. If you wana load stuff dynamically into a page you should learn AJAX ... that’s basically the "JavaScript" language of PHP ...
  2. Yes thats what i was doing for my PayPal ipn script You post your data to a PHP page where you collect your stuff then you send it back to the good place using javascript document.myform.submit();put all your stuff into hidden imput boxes.
  3. Thats a very good idea. STRSTR would be what your looking for. http://ca3.php.net/strstr
  4. oh $email = $_POST[username]."@test.info"; $INSERT= mysql_query("ISERT INTO table ('email') VALUE ('$email)") or die (mysql_error()); To insert that into a session you only use the code i gave you above. That will make the email available in every pages.
  5. Bro your aking for help on a javascript question in a PHP board ... What's your problem? I am a PHP developper not a JavaScript freak. I don't care how much big your fraustration is over the prob you have, thats not excusing the fact that you're still not in the good place for help. Here take my hand and let me bring you in the good part of the board ... http://www.phpfreaks.com/forums/index.php/board,6.0.html this guy is incredible
  6. I am not sur i understand your question ... but you could use sessions to transfer the data to an other page ... or if your realy wana "submit" as $_POST you can use JavaScript ... session_start(); $_SESSION[what_ever] = $_POST[what_ever]; Then you can use $_SESSION[what_ever] in any pages starting by session_start(); When your done using those data you can do a session_destroy(); to delete them. (They will be deleted anyway after 30 min)
  7. Thanks for asking your "JavaScript" question in a "JavaScript" forum to have a "JavaScript" awnser ... lol
  8. Hey guys i am having a hard time adding my attachements to my email using IMAP elseif ($_GET['CMD'] == "send") { // SOME SERVERS HAVE SOME DIFFERENCES - AGHR if (get_magic_quotes_gpc()) $_POST = array_map('stripslashes', $_POST); $_POST['ms'] = str_replace("\r\n", "\n", $_POST['ms']); if (!isset($_SESSION['session_server']) || !isset($_SESSION['session_username']) || !isset($_SESSION['session_password'])) { showBody(""); echo "Your session might have timed-out. "; echo "Copy the content of your e-mail below, and try again by <A href='?mod=mail&folder=$_GET[folder]'>continuing</a>..."; echo "<PRE>" . $_POST['ms'] . "</PRE>"; return; } $head = "From: $_POST[fr]\n"; if ($_POST['cc']){$head .= "CC: $_POST[cc]\n";} if ($_POST['bcc']){$head .= "BCC: $_POST[bcc]\n";} $head .= "Return-Path: <" . $_POST['fr'] . ">\n"; $head .= "Reply-to: <" . $_POST['fr'] . ">\n"; $head .= 'Content-Type: text/html; charset="iso-8859-1"' . "\n"; $head .= 'Content-Transfer-Encoding: 8bit'; $head = str_replace("'", '"', $head); $to = str_replace("'", '"', $_POST['to']); $su = stripslashes($_POST['su']); $ms = $_POST['ms']; foreach($_FILES['userfile']['tmp_name'] as $key => $value){ if (is_uploaded_file($_FILES['userfile']['tmp_name'][$key])) { Attach($_FILES['userfile']['tmp_name'][$key],$_FILES['userfile']['name'][$key]); } } if ($_POST[submit]!="Save to Drafts"){$success = mail($to, $su, html_entity_decode($ms), $head);}else{$success="true";} if ($success) { showBody(""); if ($_POST[submit]!="Save to Drafts"){echo "Mail is sent!";}else{echo "Mail is saved!";} if (isset($_POST['oldmessage']) && isset($_POST['oldmessage_delete']) && $_POST['oldmessage_delete'] == "true") { echo " Also deleting original message."; delete($_POST['oldmessage']); } $stream = imap_open("{mail.blessingstairs.org:143/imap/notls}", "$_SESSION[session_username]", "$_SESSION[session_password]"); $check = imap_check($stream); imap_append($stream, "{mail.blessingstairs.org:143/imap/notls}INBOX.Sent" , "From: $_POST[fr]\r\n" . "To: $to\r\n" . "Subject: $su\r\n" . "\r\n" . html_entity_decode($ms) . "\r\n" ); if ($_POST[submit]=="Save to Drafts"){ imap_append($stream, "{mail.blessingstairs.org:143/imap/notls}INBOX.Drafts" , "From: $_POST[fr]\r\n" . "To: $to\r\n" . "Subject: $su\r\n" . "\r\n" . html_entity_decode($ms) . "\r\n" ); }else{ imap_append($stream, "{mail.blessingstairs.org:143/imap/notls}INBOX.Drafts" , "From: $_POST[fr]\r\n" . "To: $to\r\n" . "Subject: $su\r\n" . "\r\n" . html_entity_decode($ms) . "\r\n" ); } $check = imap_check($stream); imap_close($stream); if ($_POST[submit]=="Save to Drafts"){ echo "<META HTTP-EQUIV='Refresh' CONTENT='0;url=?mod=mail&folder=INBOX.Drafts'></META>"; }else{ echo "<META HTTP-EQUIV='Refresh' CONTENT='0;url=?mod=mail&folder="; if (isset($_GET['folder'])) echo $_GET['folder']; echo "'></META>"; } //print ("message: <br>".html_entity_decode($ms)."<br><br><hr><br>"); } function Attach($AttmFile, $FileName) { global $ms, $head;// orginele message en headers $Text = $ms; $Html = $ms;// html is niet meer actief want wordt niet goed weergegeven na invoer if ($Text == "") { $Text = " "; $Html = " "; } $OB = "----=_OuterBoundary_000"; $IB = "----=_InnerBoundery_001"; $Html = $Html ? $Html:preg_replace("/\n/", "{br}", $Text) or die("neither text nor html part present."); $Text = $Text ? $Text:"Sorry, but you need an html mailer to read this mail."; $headers = "MIME-Version: 1.0\r\n"; $headers .= $head;// toevoeging orginele headers (from en to enzo) $headers .= "X-Priority: 1\n"; // $headers.="X-MSMail-Priority: High\n"; // $headers.="X-Mailer: OneFile\n"; $headers .= "Content-Type: multipart/mixed;\n\tboundary=\"" . $OB . "\"\n"; //Messages start with text/html alternatives in OB $Msg = "This is a multi-part message in MIME format.\n"; $Msg .= "\n--" . $OB . "\n"; $Msg .= "Content-Type: multipart/alternative;\n\tboundary=\"" . $IB . "\"\n\n"; //plaintext section $Msg .= "\n--" . $IB . "\n"; $Msg .= "Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n"; $Msg .= "Content-Transfer-Encoding: quoted-printable\n\n"; // plaintext goes here $Msg .= $Text . "\n\n"; /* // html section $Msg.="\n--".$IB."\n"; $Msg.="Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n"; $Msg.="Content-Transfer-Encoding: base64\n\n"; // html goes here $Msg.=chunk_split(base64_encode($Html))."\n\n"; */ // end of IB $Msg .= "\n--" . $IB . "--\n"; // attachments (dit was eerst een loop, dus dit kan voor meerdere files ook zo) // attachments (dit was eerst een loop, dus dit kan voor meerdere files ook zo) $patharray = explode("/", $AttmFile); $Msg .= "\n--" . $OB . "\n"; $Msg .= "Content-Type: application/octetstream;\n\tname=\"" . $FileName . "\"\n"; $Msg .= "Content-Transfer-Encoding: base64\n"; $Msg .= "Content-Disposition: attachment;\n\tfilename=\"" . $FileName . "\"\n\n"; //file goes here $fd = fopen($AttmFile, "r"); if (!$fd) die("Could not open uploaded file on the server"); $FileContent = fread($fd, filesize($AttmFile)); fclose($fd); $FileContent = chunk_split(base64_encode($FileContent)); $Msg .= $FileContent; $Msg .= "\n\n"; // attachments (dit was eerst een loop, dus dit kan voor meerdere files ook zo) // attachments (dit was eerst een loop, dus dit kan voor meerdere files ook zo) //message ends $Msg .= "\n--" . $OB . "--\n"; // teruggeven naar global $ms = $Msg; $head = $headers; }
  9. i did'int check a lot but first off, $login = clean($_POST['login']); $password = clean($_POST['password']); On this line your cleaning the vars ... so from this point stop using $_POST and start using $login and $password
  10. I am trying to do a multiple file uploader ... every imput has the name userfile[] foreach ($_FILES['userfile'] as $fi){ if (is_uploaded_file($fi['tmp_name'])) { Attach($fi['tmp_name'],$fi['name']); } } For some reason $fi['tmp_name'] returns null bot not $_FILES['userfile']['tmp_name'] ...
  11. looks like a script config problem...but with no code, no way to help you out ...
  12. select the password from the table called TBL_USERS where the username is equal to $username Then if no result (!$result) or numbers of row is smaller then 1 (mysql_numrows($result) < 1)) it return 1 (username failure)
  13. jquery.com Looks like a good website thx bro
  14. Hey bro are you kidding me? I just told you how ... and it even been quoted 2 times ... <?php $File = "config.php"; $Handle = fopen($File, 'w'); $Data = '$foo = '.$bar.'; \n'; print "Data Written"; fclose($Handle); ?>
  15. With that added. Now all you need to do is include the config.php into where ever it's suppose to go. Reminder: Becuase the config.php will not exist and/or not have the proper variables assigned, you need to create a check, otherwise you will run into some errors. and you can do that like this <?php $filename = '/pathto/config.php'; if (file_exists($filename)) { echo "The file $filename exists"; } else { echo "The file $filename does not exist"; } ?>
  16. Yeah ... AJAX is something i never touched actually ... i always managed to do my stuff with out it ... Guess i can't run from it anymore. Everything i did in javascript was for nothing lol... Should of been in AJAX straight up. Thx bro i will start looking for some code examples and put my self to it. If you have anything to suggest that would do something close to it go a head ;-)
  17. fopen and fwrite ;-) The fopen function needs two important pieces of information to operate correctly. First, we must supply it with the name of the file that we want it to open. Secondly, we must tell the function what we plan on doing with that file. Since we want to create a file, we must supply a file name and tell PHP that we want to write to the file. Note: We have to tell PHP we are writing to the file, otherwise it will not create a new file. PHP Code: $ourFileName = "config.php"; $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file"); fclose($ourFileHandle); The file "config.php" should be created in the same directory where this PHP code resides. PHP will see that "config.php" does not exist and will create it after running this code. Now we can use the fwrite command to add data to our file. We would do this as shown below: <?php $File = "YourFile.txt"; $Handle = fopen($File, 'w'); $Data = "Jane Doe\n"; fwrite($Handle, $Data); $Data = "Bilbo Jones\n"; fwrite($Handle, $Data); print "Data Written"; fclose($Handle); ?>
  18. You have to give the value to your session $_SESSION['member_id'] = $_POST[member_id]; Only after that the $_SESSION['member_id'] will be available everywhere the page starts by SESSION_START()
  19. Hey pros ;-) I am in the process of creating a webmail for a client. He paid for something very sophisticated so ia m trying to do this the best way possible. Right now I am working on the attachments feature when you send out your email. The Gmail system was really the best attachments way I saw so I reverse engineered it and modified it to suite my needs. Works like a charm using Java Script. When you press the attachments button there’s a box to brows that appears. You can add up to 10 and you can also delete any box with a remove link. Now for the tricky part ... I would like to know how it would be possible to make it upload right away but without reloading the page because you got to keep in mind that the guy is still composing his message. I think hotmail has a system like it. You can see a circle while the file is being processed and while it is you can continue your stuff.. So in a more clear way: How can you make an uploading box upload as soon as the file is selected ... how can you delete that file if the user presses on remove and how can you send those files using imap as an attachments? Let see how the legends of PHPFreaks solves this ;-)
  20. You can only know if the mail() function worked ... after that it depens on the mail server that catches it ...
  21. $words = explode (' ', $string); foreach ($words as $loop){ echo $loop."<br>"; } or echo str_replace(' ', '<br>', $string); cheers
  22. well did you declar query() somewhere?
×
×
  • 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.