הרשם שאלות ותשובות רשימת חברים לוח שנה הודעות מהיום

חזור   הוסטס - פורום אחסון האתרים הגדול בישראל > עיצוב גראפי, תכנות על כל שפותיו וקידום ושיווק אתרים > פורום תיכנות

   
|!|

השב
 
כלים לאשכול תצורת הצגה
ישן 17-07-07, 22:15   # 1
ddd789
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jun 2006
הודעות: 166

ddd789 לא מחובר  

עזרה שליחת משתנים לאיימל

שלום יש לי את הקוד הבא
PHP קוד:
<?php 

$domain 
$_SERVER['HTTP_HOST']; // מצא את הדומיין שלך 


$path $_SERVER['SCRIPT_NAME']; // מציאת הנתיב לקובץ הנוכחי 

$queryString $_SERVER['QUERY_STRING']; // מציאת השאילתא (המשתנים בURL שנשלחים דרך GET) 

// חיבור של כל המידע ביחד 

$fullurl "http://" $domain $path "?" $queryString

echo 
"כתובת העמוד המלאה שאתה נמצא בו: " $fullurl "
"


?>
ואני רוצה שכול המידע ישלח לאיימל איך אני עושה את זה? בבקשה תסבירו
  Reply With Quote
ישן 17-07-07, 22:16   # 2
RS324
תודה על תרומתך.
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 3,173

RS324 לא מחובר  

www.php.net/mail
  Reply With Quote
ישן 17-07-07, 22:19   # 3
ddd789
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jun 2006
הודעות: 166

ddd789 לא מחובר  

קראתי שם ולא הבנתי כלום..
  Reply With Quote
ישן 17-07-07, 22:21   # 4
RS324
תודה על תרומתך.
 
מיני פרופיל
תאריך הצטרפות: May 2006
הודעות: 3,173

RS324 לא מחובר  

אם טיפה היית מתאמץ (קצת יותר מ 2 וחצי דקות)

אתה היית רואה שיש הרבה פונקציות שאנשים כתבו שיכולות לעזור לך כמו זו לדוגמא :

PHP קוד:
<?php
function send_mail($emailaddress$fromaddress$emailsubject$body$attachments=false)
{
  
$eol="\r\n";
  
$mime_boundary=md5(time());
 
  
# Common Headers
  
$headers .= 'From: MyName<'.$fromaddress.'>'.$eol;
  
$headers .= 'Reply-To: MyName<'.$fromaddress.'>'.$eol;
  
$headers .= 'Return-Path: MyName<'.$fromaddress.'>'.$eol;    // these two to set reply address
  
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
  
$headers .= "X-Mailer: PHP v".phpversion().$eol;          // These two to help avoid spam-filters

  # Boundry for marking the split & Multitype Headers
  
$headers .= 'MIME-Version: 1.0'.$eol;
  
$headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;

  
$msg "";     
 
  if (
$attachments !== false)
  {

    for(
$i=0$i count($attachments); $i++)
    {
      if (
is_file($attachments[$i]["file"]))
      {  
        
# File for Attachment
        
$file_name substr($attachments[$i]["file"], (strrpos($attachments[$i]["file"], "/")+1));
       
        
$handle=fopen($attachments[$i]["file"], 'rb');
        
$f_contents=fread($handlefilesize($attachments[$i]["file"]));
        
$f_contents=chunk_split(base64_encode($f_contents));    //Encode The Data For Transition using base64_encode();
        
fclose($handle);
       
        
# Attachment
        
$msg .= "--".$mime_boundary.$eol;
        
$msg .= "Content-Type: ".$attachments[$i]["content_type"]."; name=\"".$file_name."\"".$eol;
        
$msg .= "Content-Transfer-Encoding: base64".$eol;
        
$msg .= "Content-Disposition: attachment; filename=\"".$file_name."\"".$eol.$eol// !! This line needs TWO end of lines !! IMPORTANT !!
        
$msg .= $f_contents.$eol.$eol;
       
      }
    }
  }
 
  
# Setup for text OR html
  
$msg .= "Content-Type: multipart/alternative".$eol;
 
  
# Text Version
  
$msg .= "--".$mime_boundary.$eol;
  
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
  
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
  
$msg .= strip_tags(str_replace("<br>""\n"$body)).$eol.$eol;
 
  
# HTML Version
  
$msg .= "--".$mime_boundary.$eol;
  
$msg .= "Content-Type: text/html; charset=iso-8859-1".$eol;
  
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
  
$msg .= $body.$eol.$eol;
 
  
# Finished
  
$msg .= "--".$mime_boundary."--".$eol.$eol;  // finish with two eol's for better security. see Injection.
   
  # SEND THE EMAIL
  
ini_set(sendmail_from,$fromaddress);  // the INI lines are to force the From Address to be used !
  
mail($emailaddress$emailsubject$msg$headers);
  
ini_restore(sendmail_from);
  echo 
"mail send";
}

 
# To Email Address
$emailaddress="to@address.com";

# From Email Address
$fromaddress "from@address.com";

# Message Subject
$emailsubject="This is a test mail with some attachments";

# Use relative paths to the attachments
$attachments = Array(
  Array(
"file"=>"../../test.doc""content_type"=>"application/msword"),
  Array(
"file"=>"../../123.pdf""content_type"=>"application/pdf")
);

# Message Body
$body="This is a message with <b>".count($attachments)."</b> attachments and maybe some <i>HTML</i>!";

send_mail($emailaddress$fromaddress$emailsubject$body$attachments);
?>
אני ממליץ לך ללמוד קצת על השימוש באתר php.net הוא יעזור לך מאד.
  Reply With Quote
ישן 17-07-07, 22:21   # 5
Tomer
Whatever
 
Tomer's Avatar
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 7,039
שלח הודעה באמצעות MSN אל Tomer Send a message via Skype™ to Tomer

Tomer לא מחובר  

וואלה? לא הבנת כלום? תנסה שוב.

http://www.php.net/manual/en/function.mail.php

יופי רותם :\
__________________
תומר
  Reply With Quote
ישן 17-07-07, 22:22   # 6
ddd789
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jun 2006
הודעות: 166

ddd789 לא מחובר  

נגיד ויש לי את הטופס הזה איך אני משלב אותו ששילח את הפרטים לאיימיל ? תסבירו
  Reply With Quote
ישן 17-07-07, 22:23   # 7
ddd789
חבר בקהילה
 
מיני פרופיל
תאריך הצטרפות: Jun 2006
הודעות: 166

ddd789 לא מחובר  

ערכיה
<?php
$to = 'ddd789@gmail.com';
$subject = 'the subject';
$message = '$domain ';
$headers = 'From: webmaster@example.com' . "\r\n" .
'Reply-To: webmaster@example.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();

mail($to, $subject, $message, $headers);


$domain = $_SERVER['HTTP_HOST']; // מצא את הדומיין שלך


$path = $_SERVER['SCRIPT_NAME']; // מציאת הנתיב לקובץ הנוכחי

$queryString = $_SERVER['QUERY_STRING']; // מציאת השאילתא (המשתנים בURL שנשלחים דרך GET)

// חיבור של כל המידע ביחד

$fullurl = "http://" . $domain . $path . "?" . $queryString;

echo "כתובת העמוד המלאה שאתה נמצא בו: " . $fullurl . "
";

?>
ניסתי ככה אבל זה שולח לי רק domain$ בטקסט

Last edited by ddd789; 17-07-07 at 22:34..
  Reply With Quote
ישן 17-07-07, 23:30   # 8
syn
הוסטסניון
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
הודעות: 1,919

syn לא מחובר  

קוד:
$fullurl = "http://$domain$path?$queryString";
  Reply With Quote
השב

חברים פעילים הצופים באשכול זה: 1 (0 חברים ו- 1 אורחים)
 


חוקי פירסום
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is מופעל
סמיילים הם מופעל
[IMG] קוד מופעל
קוד HTML מכובה

קפיצה לפורום


כל הזמנים הם GMT +2. הזמן כעת הוא 13:17.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ