<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Rank

How To Open Standard Output as a File Handle
How To Open Standard Output as a File Handle? - PHP Script Tips - Reading and Writing Files If you want to open the standard output as a file handle yourself, you can use the fopen("php://stdout") function. It creates a special file handle linking to the standard output, and returns the file handle....
2007-04-23, 4842👍, 0💬

What Are the Input Values of SELECT Tags
What Are the Input Values of SELECT Tags? - PHP Script Tips - Processing Web Forms SELECT tags are used in forms to provide dropdown lists. Entris in a dropdown list are defined by OPTION tags, which can provide input values in two ways: Implicit value - Provided as &lt;OPTION>input_value& ;lt...
2007-04-23, 4946👍, 0💬

How To List All Values of Submitted Fields
How To List All Values of Submitted Fields? - PHP Script Tips - Processing Web Forms If you want list all values of submitted fields, you can write a simple loop to retrieve all entries in the $_REQUEST array. Below is an improved version of processing_forms.php to list all submited input values: &a...
2007-04-23, 6509👍, 0💬

How To Write an Array to a File without a File Handle
How To Write an Array to a File without a File Handle? - PHP Script Tips - Reading and Writing Files If you have an array, want to write it to a file, and you don't want to open the file with a file handle, you can use the file_put_contents(). It opens the specified file, writes all values from the ...
2007-04-23, 4645👍, 0💬

How To Write a String to a File without a File Handle
How To Write a String to a File without a File Handle? - PHP Script Tips - Reading and Writing Files If you have a string, want to write it to a file, and you don't want to open the file with a file handle, you can use the file_put_contents(). It opens the specified file, writes the specified string...
2007-04-23, 4760👍, 0💬

How To Specify Input Values for Radio Buttons
How To Specify Input Values for Radio Buttons? - PHP Script Tips - Processing Web Forms Radio buttons can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=RADIO ...> tag, with no input value specified. When submitted with button pushed down, you will receive a value ...
2007-04-23, 4926👍, 0💬

How To Specify Input Values for Checkboxes
How To Specify Input Values for Checkboxes? - PHP Script Tips - Processing Web Forms Checkboxes can be used in a form for two situations: As a single switch - One &lt;INPUT TYPE=CHECKBOX ...> tag, with no input value specified. When submitted with button pushed down, you will receive a value of ...
2007-04-23, 4753👍, 0💬

How To Write a String to a File with a File Handle
How To Write a String to a File with a File Handle? - PHP Script Tips - Reading and Writing Files If you have a file handle linked to a file opened for writing, and you want to write a string to the file, you can use the fwrite() function. It will write the string to the file where the file pointer ...
2007-04-23, 5092👍, 0💬

How To Read a File in Binary Mode
How To Read a File in Binary Mode? - PHP Script Tips - Reading and Writing Files If you have a file that stores binary data, like an executable program or picture file, you need to read the file in binary mode to ensure that none of the data gets modified during the reading process. You need to: Ope...
2007-04-23, 5304👍, 0💬

How To Supply Default Values for Text Fields
How To Supply Default Values for Text Fields? - PHP Script Tips - Processing Web Forms If you want to provide a default value to a text field in your form, you need to pay attention to following notes: The default value should be provided in the 'VALUE=default_value' attribute in the &ltINPUT TY...
2007-04-22, 5257👍, 0💬

How To Read One Character from a File
How To Read One Character from a File? - PHP Script Tips - Reading and Writing Files If you have a text file, and you want to read the file one character at a time, you can use the fgetc() function. It reads the current character, moves the file pointer to the next character, and returns the charact...
2007-04-22, 4837👍, 0💬

What's Wrong with "while ($c=fgetc($f)) {}"
What's Wrong with "while ($c=fgetc($f)) {}"? - PHP Script Tips - Reading and Writing Files If you are using "while ($c=fgetc($f)) {}" to loop through each character in a file, the loop may end in the middle of the file when there is a "0" character, because PHP treats "0" as Boolean false. To proper...
2007-04-22, 4704👍, 0💬

How To Remove Slashes on Submitted Input Values
How To Remove Slashes on Submitted Input Values? - PHP Script Tips - Processing Web Forms By default, when input values are submitted to the PHP engine, it will add slashes to protect single quotes and double quotes. You should remove those slashes to get the original values by applying the stripsla...
2007-04-22, 5315👍, 0💬

How To Support Multiple Submit Buttons
How To Support Multiple Submit Buttons? - PHP Script Tips - Processing Web Forms Sometimes, you may need to give visitors multiple submit buttons on a single form to allow them to submit the form for different purposes. For example, when you show your customer a purchase order in a Web form, you may...
2007-04-22, 4798👍, 0💬

How To Append New Data to the End of a File
How To Append New Data to the End of a File? - PHP Script Tips - Reading and Writing Files If you have an existing file, and want to write more data to the end of the file, you can use the fopen($fileName, "a") function. It opens the specified file, moves the file pointer to the end of the file, and...
2007-04-22, 4849👍, 0💬

How To Read One Line of Text from a File
How To Read One Line of Text from a File? - PHP Script Tips - Reading and Writing Files If you have a text file with multiple lines, and you want to read those lines one line at a time, you can use the fgets() function. It reads the current line up to the "\n" character, moves the file pointer to th...
2007-04-22, 5063👍, 0💬

How To Generate and Process a Form with the Same Script
How To Generate and Process a Form with the Same Script? - PHP Script Tips - Processing Web Forms In previous exercises, a Web form is generated by one script, and processed by another script. But you could write a single script to do both. You just need to remember to: Use same script name as the f...
2007-04-22, 4956👍, 0💬

How To Support Hidden Form Fields
How To Support Hidden Form Fields? - PHP Script Tips - Processing Web Forms Hidden fields are special fields in a form that are not shown on the Web page. But when the form is submitted, values specified in the hidden fields are also submitted to the Web server. A hidden field can be specified with ...
2007-04-22, 4708👍, 0💬

How To Open a File for Writing
How To Open a File for Writing? - PHP Script Tips - Reading and Writing Files If you want to open a new file and write date to the file, you can use the fopen($fileName, "w") function. It creates the specified file, and returns a file handle. The second argument "w" tells PHP to open the file for wr...
2007-04-22, 4608👍, 0💬

How To Open a File for Reading
How To Open a File for Reading? - PHP Script Tips - Reading and Writing Files If you want to open a file and read its contents piece by piece, you can use the fopen($fileName, "r") function. It opens the specified file, and returns a file handle. The second argument "r" tells PHP to open the file fo...
2007-04-22, 4704👍, 0💬

How To Retrieve the Original Query String
How To Retrieve the Original Query String? - PHP Script Tips - Processing Web Forms If you have coded some values in the URL without using the standard form GET format, you need to retrieve those values in the original query string in $_SERVER['QUERY_STRING']. The script below is an enhanced version...
2007-04-22, 4602👍, 0💬

How To Submit Values without a Form
How To Submit Values without a Form? - PHP Script Tips - Processing Web Forms If you know the values you want to submit, you can code the values in a hyper link at the end of the URL. The additional values provided at the end of a URL is called query string. There are two suggestions on how to use q...
2007-04-22, 4993👍, 0💬

How To Read the Entire File into a Single String
How To Read the Entire File into a Single String? - PHP Script Tips - Reading and Writing Files If you have a file, and you want to read the entire file into a single string, you can use the file_get_contents() function. It opens the specified file, reads all characters in the file, and returns them...
2007-04-22, 4732👍, 0💬

How To Read a Text File into an Array
How To Read a Text File into an Array? - PHP Script Tips - Reading and Writing Files If you have a text file with multiple lines, and you want to read those lines into an array, you can use the file() function. It opens the specified file, reads all the lines, puts each line as a value in an array, ...
2007-04-22, 4850👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Rank