Ok, as requested i'm gonna add a lil of my script.
//extract all varriable names from template file and save names to arr +ay. $clean_vars = gleen_vars(); //extract outgoing mail format from template file. $fd = fopen ($template, "r") or die("Could not open template file"); $mail_out = fread ($fd, filesize($template)); fclose ($fd); //replace varribles in template with varriables from input. $i="0"; $replaced_var = "$$clean_vars"; echo $replaced_var[2][2]; while($clean_vars[2][$i]){ str_replace("%$clean_vars[$i]%","$replaced_var[2][$i]",$mail_out); echo $clean_vars[2][$i]; echo $replaced_var[2][$i]; echo "<br><br>"; $i++; } echo $replaced_var[2][2]; echo $mail_out; break; //seperate out the header information and create varriables to, and fr +om. list($header,$mail_out) = preg_split("%Begin Email%",$mail_out,2); list($to,$from) = preg_split("/[\n]+/",$header); list($crap,$to)=split(":",$to); list($crap,$from)=split(":",$from); //output to mailer deamon sndmail($to,$from,$title,$mail_out); logdata($to,$from,$title,1); /********************************************************************* +***********************/ /* + */ /* gleen_vars function: reads and puts incomming arrays (from template + file) into an array */ /* + */ /********************************************************************* +***********************/ function gleen_vars() { $template = "template.php"; $fd = fopen ("$template", "r") or die("Could not open template fil +e"); $contents = fread ($fd, filesize($template)); fclose ($fd); if(preg_match_all ("/(%) ([_0-9a-zA-Z]*) (%)/x", "$contents", $pre +_vars, PREG_PATTERN_ORDER)){ return($pre_vars); }else{ error("No varriables defined in the template script: $template") +; return(0); } }

In reply to Re: Transfering Varriables by £okì
in thread Transfering Varriables by £okì

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.