Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Forms, Text Files, And Php For A Signature Generator., Help a little.
Imtay22
post Apr 15 2007, 02:26 PM
Post #1


Super Member
*********

Group: Members
Posts: 292
Joined: 27-January 07
From: Winter is cold here.
Member No.: 37,984
Spam Patrol



Hello everyone! I am in need of some code a for a signature generator I am making. I am using BuffaloHELP's code for the php file, now I am trying to improve that code by making a form in a html file that will have the user say what is on the sig! But now, I need help getting the form data that is posted by the user to get into that sig! There is a file, sig.txt, where that tells the php file what text will go on the sig. But how can I make the form data in the html file go into the text file so it will go onto the sig? You might want to read BuffaloHELP's code. You can find it in probably simalar topics or scroll down some in the php forum. Thanks All!

PS. BuffaloHELP's Topic is called dynamic image/ sig generator.

This post has been edited by Imtay22: Apr 15 2007, 02:27 PM
Go to the top of the page
 
+Quote Post
galexcd
post May 6 2007, 11:53 PM
Post #2


Define:EVIL PROGRAMMER (ē'vəl prō'grăm'ər)- n. An organism that converts caffeine into evil software.
*********

Group: [HOSTED]
Posts: 975
Joined: 25-September 05
From: The dungeon deep below the foundation of trap17
Member No.: 12,251



You need to use the fopen and fwrite functions. That is if I understand you right.

So have the html form submit to a php page that gets all of the vars that the form sent to you and use something like this to modify the text file:

CODE
$file=fopen("name of text file.txt", 'w');
fwrite($file,"Data to put into the text file");
fclose($file);


For the mode (the second paramater of the fopen function), here is a list of what strings do different stuff.

(taken from php.net)
QUOTE
r' Open for reading only; place the file pointer at the beginning of the file.
'r+' Open for reading and writing; place the file pointer at the beginning of the file.
'w' Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
'w+' Open for reading and writing; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
'a' Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
'a+' Open for reading and writing; place the file pointer at the end of the file. If the file does not exist, attempt to create it.
'x' Create and open for writing only; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files.
'x+' Create and open for reading and writing; place the file pointer at the beginning of the file. If the file already exists, the fopen() call will fail by returning FALSE and generating an error of level E_WARNING. If the file does not exist, attempt to create it. This is equivalent to specifying O_EXCL|O_CREAT flags for the underlying open(2) system call. This option is supported in PHP 4.3.2 and later, and only works for local files.


I hope this helps!

This post has been edited by alex7h3pr0gr4m3r: May 6 2007, 11:54 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Converting Video Files From One Format To Another(6)
  2. The Best And Free Website/html Editors + Text Editors(48)
  3. Does Anyone Know How To Make Exe Files(17)
  4. Css Layout Generator - *free*(3)
  5. Putting A Signature On The Forum(35)
  6. Linux Question: Amarok And File Permissions(4)
  7. Strange .log Files On My Desktop(10)
  8. Informix To Sql Server (or How To Open .unl Files)(2)
  9. Qupis : Free Hosting With Php, Mysql, Cpanel. (one Line Text Ad At Bottom)(41)
  10. Mario Signature (adobe Photoshop)(15)
  11. Adding Shine To Text(1)
  12. How To Disable "show Hidden Files And Folders" In Folder Option(11)
  13. What Program Do You Use To Design Your Web?(82)
  14. How To Use Command Prompt As A Text Editor(6)
  15. Gimp Abstract Signature Tutorial(9)
  1. Text Based Game(5)
  2. Converting Audio Files In Vista(7)
  3. Text Size Problem(6)
  4. Mysql(2)
  5. Recent Signature(6)
  6. Debug Exe Files(4)
  7. Text Based Rpg Game Maker(3)
  8. 1350 Great Free Logos (jpg + Psd)(7)
  9. Best Way To Transfer Files(6)
  10. Text Editors Vs Word Processors(1)
  11. Jar Executable Files(1)
  12. Audio Files?(3)
  13. Naming Web Page Files(5)


 



- Lo-Fi Version Time is now: 25th July 2008 - 08:44 PM