Jump to content
xisto Community

tuddy

Members
  • Content Count

    572
  • Joined

  • Last visited

Posts posted by tuddy


  1. Just for someone whom knows, How does the deduction for something work?I'll give an example, ie. What happened to me :)I made a post with my PHP code, asking for help finding the error. I forgot to put the code in quote tags. and from having 13 credits i went down to 1. before making that post i had about 8.7. Is there a way the deduction is made?

    Notice from BuffaloHELP:
    Merged two posts. I'm assuming the first post was submitted without completion.

  2. Depends on what you need it for?...ie. Is it for bussiness or personal use.Do you care for certain features and support?Do you like to be stylish and funky? :)Personally, i'd move away from Nokia, nokia have good features and all, but there support lacks from experience of screens break, keys and just going smoky! :D


  3. Just wondering if there is a flash version for PC of this game out?I thought i heard and seen it once, but don;t know wether there really is? anyone know?I'm a James Bond Freak, i have watched all movies, and will never miss a future one. I'm an action freak..James Bond, 24, Alias, Theat Matrix...All great!I've gone through that game a number of times, and my family is trying to buy it, can't find it anyway. :) We live sorta in the country! Kills the hours quickly though! :D Tuddy out...


  4. Hopefully then, anything that people want will be created and have also a friendly user, and enviroment friendly impact to our socity of living.Life can only get better...Well just wait and see, hopefully i'm still alive to see that day. Maybe we won't have to have services like 'Trap 17' in the future, maybe it will all be built in for every member of the universe to have his/her own personal electronic space. -_-


  5. In the future the whole wide world will just become Computerized! Cars that will automatically drive you to a destination you specify. No gardening required, No nothing, just set back and watch a huge screen in your own home. I can't wait for the day everything is run by computers, and someone gets the brain to come up with a virus able to bring down all computerized machines. We can just sit around and wait! -_-


  6. I suggest using the include() function.. anyways, try using the QUOTE bbCode when posing a PHP code. Because a moderator or an Admin might warn you. -_-

    173882[/snapback]


    How would i use include() within my script? I dont want any of the script to show something in the browser, which what include() would do, wouldn't it?

     

    The way to get rid of my errors is to have the values replaced, but why won;t my script replace them?, it just writes over everything with a blank page. :S


  7. I have the following code now,

     

    
    

    $file2 = 'files/leave1.txt';

    $file3 = 'files/leave1.htm';

     

    copy ($file1, $file2);

     

    $from=array();

    $from[]="<<number>>";

    $from[]="<<rank>>";

    $from[]="<<initials>>";

    $from[]="<<family>>";

    $from[]="<<datef>>";

    $from[]="<<datet>>";

    $from[]="<<dates>>";

    //and so on to have all the fields you want to replace

     

    $to=array();

    $to[]=$number;

    $to[]=$rank;

    $to[]=$initials;

    $to[]=$family;

    $to[]=$datef;

    $to[]=$datet;

    $to[]=$dates;

    //And so on to have all the strings you have to put in place of the fields

     

    $string=str_replace($from,$to,$string);

    $fp = fopen( "$file2" , "w" );

    fputs( $fp, $string );

    fclose( $fp );

     

    copy ($file2, $file3);

    $fileatt = "files/leave1.htm"; // Path to the file

    $fileatt_type = "application/octet-stream"; // File Type

    $fileatt_name = "leave1.htm"; // Filename that will be used for the file as the attachment

     

    $email_from = "Test"; // Who the email is from

    $email_subject = "Leave Application"; // The Subject of the email

    $email_message = "This is a Leave Application."; // Message that the email has in it

     

    $email_to = "cm44750@cadetnet.gov.au"; // Who the email is too

     

    $headers = "From linenums:0'><?php $file1 = 'files/leave.txt';$file2 = 'files/leave1.txt';$file3 = 'files/leave1.htm';copy ($file1, $file2);$from=array();$from[]="<<number>>";$from[]="<<rank>>";$from[]="<<initials>>";$from[]="<<family>>";$from[]="<<datef>>";$from[]="<<datet>>";$from[]="<<dates>>";//and so on to have all the fields you want to replace$to=array();$to[]=$number;$to[]=$rank;$to[]=$initials;$to[]=$family;$to[]=$datef;$to[]=$datet;$to[]=$dates;//And so on to have all the strings you have to put in place of the fields$string=str_replace($from,$to,$string);$fp = fopen( "$file2" , "w" );fputs( $fp, $string );fclose( $fp );copy ($file2, $file3);$fileatt = "files/leave1.htm"; // Path to the file $fileatt_type = "application/octet-stream"; // File Type $fileatt_name = "leave1.htm"; // Filename that will be used for the file as the attachment $email_from = "Test"; // Who the email is from $email_subject = "Leave Application"; // The Subject of the email $email_message = "This is a Leave Application."; // Message that the email has in it $email_to = "cm44750@cadetnet.gov.au"; // Who the email is too $headers = "From: ".$email_from; $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message . "\n\n"; /********************************************** First File ********************************************/ $fileatt = "files/leave1.htm"; // Path to the file $fileatt_type = "application/octet-stream"; // File Type $fileatt_name = "leave1.htm"; // Filename that will be used for the file as the attachment $file = fopen($fileatt,'rb'); $data = fgets($file,filesize($file)); fclose($file); $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; /********************************************** Second File ********************************************/ // To add more files just copy the file section again, but make sure they are all one after the other! If they are not it will not work! $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "<font face=verdana size=2>The Leave Application was successfully sent!</font>"; } else { die("Sorry but the Leave Application could not be sent. Please go back and try again!"); } unlink( "$file2" );unlink( "$file3" );?>


    Now the problem i face is the errors i get with it. these errors being:

     

    Warning: filesize(): Stat failed for Resource id #7 (errno=2 - No such file or directory) in /home/tuddy/public_html/pro.php on line 78

    Warning: fgets(): Length parameter must be greater than 0. in /home/tuddy/public_html/pro.php on line 78

    Line 78 is: $data = fgets($file,filesize($file));

     

    I have studied and changed this code around and can't get it to work, the attachment i get is blank, but its supposed to have the placeholders replaced?

     

    Any ideas?

     

    Notice from cmatcmextra:
    Added codebox and quote tags. Warned. Also I'm deducing the credits earnt for this post.


  8. Thanks, it work alittle, but not properly. so i have thought of another way to do it.All this will be done by the one form processer (PHP Page)1) Open the text file. (This text file contains HTML Code with 'placeholders for where the form data will be submitted in place of.)2) Write the form data to the text file, replacing only the placeholders.3) Then save it as a new file, but changing it to (something.html) everytime, to the server.4) Then have a Email send the 'new' file as an attachment.5) Then delete the 'new' file from the server ready for the next form to be submitted.Opening the file i can do.Replacing placeholders i can have a crack at.but i get stuck again with, How do i save it as a new file, and change the file type?


  9. Is there a way to have PHP read a text file, which contains HTML Code, not text to display. This way i have a simple code in every page, linking to this text file, and then if i'm wanting to change the code, i only need to change the code in the text file. If that all makes sense? -_- I get the feeling it can be done, but the only code i have seen is one that displays the contents of the text files.


  10. Hi,Does anyone know how i can do this, or scripts that will work on Xisto's servers and will do the following:I have a .doc file form. Which i want to have filled in automactically, by HTML Form and emailed to my address, with the data filled in.Any ideas?I have heard many differing things, like XML, RTF, DOC, PDF...I have serched through many places and come up empty handed with anything that works. :D


  11. You can just use Internet Explorer too, but why would you want to? :D

    Also good to mention Passive Mode, as some FTP Clients will automactically set this to default, and cannot connect if the server doesn't allow it.

    The data transfer process (DTP) for FTP establishes and manages the data connection.  The DTP can be passive or active. Passive, or PASV, is a command that requests that the server "listen" on a data port (which is not its default data port) and to wait for a connection rather than initiate one upon receipt of a transfer command. Certain FTP servers support both active and passive transfers while other FTP servers only allow active transfers.

    From Webopedia.
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.