I’ve made a form. Currently this form does the following operations: customer fills up the form (creates an order) clicks on “Submit” button all form entries are entered into a database. I’d like to change it to do the following operations: customer fills up the form in the end of the …
Count number of columns in a CSV file, using PHP?
Is it possible to validate a text file before I dump its data into a MYSQL database? I want to check if it contains, say, 5 columns (of data). If so, then i go ahead with the following query: LOAD …
What is data serialization?
First of all, I couldn’t get clear definition of it from WikiPedia or even from serialize function in the PHP manual. I need to know some cases where we need the term serialization and how things are …
PHP cURL/Socket and HTTP authentication
I have a webpage with a list of HTML links for images in a protected subfolder. This folder is protected via .htaccess and HTTP authentication. Is there a way to use cURL/Socket, or something like …
How to use session_start in WordPress?
I’m creating a bilingual site and have decided to use session_start to determine the language of the page using the following: session_start(); if(!isset($_SESSION[‘language’])){ $_SESSION[‘…
Validate Mobile number in php form
I want to validate mobile number of 10 digits and also add a prefix of 0 when I enter into the database. <?php include ('database_connection.php'); $citystate = $_POST['citystate']; $…
Strict Standards: Only variables should be assigned by reference PHP 5.4
I upgraded my PHP version to 5.4 (XAMPP 1.7.3 to 1.8.0). Now I see Strict Standards error, for myDBconnection: Strict Standards: Only variables should be assigned by reference in C:xampphtdocs…
Predis is giving ‘Error while reading line from server’
I am using predis, it’s subscribed to a channel and listening. It throws the following error (below) and dies after 60 secs exactly. It’s surely not my web servers error or its timeout. There is a similar issue being discussed here. Could not get much of it. I tried setting connection_timeout in p…
Resize textarea based on lines of text that comes from php/mysql variable
I dont need it to resize automatically as you type, I just need it to be the correct size when the page loads the variable is $row[‘text’]; <? echo $row['text']…
Unset post variables after form submission
Is there a way to do the above? Basically, I don’t want the form to be submitted again if someone presses refresh after already submitting the form once. In which case the browser asks, do you want to …