AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
Can you post the last solution you have tried so we can steer you in the right direction.
-
Okay let me start from the beginning since you are not understanding basic language. In the original post, all the OP states is that he/she is validating a form by posting it to itself. Sticky input values alone are not validation. I would like the OP to post the code he is using to validate the form so I may check it, since his post was extremely brief and misled me as to how he is actually validating the form.
-
The reason I asked that question was to make sure that the OP is validating the user input correctly.
-
By using the selected attribute with the <option> tag. How is posting the form to itself validation?
-
Change ([a-z/]+) to ([a-z/]+(?:\s[a-z/]+)?) this will allow an optional second word for the weather condition.
-
drunkelf, If you would like to study further what neil is talking about, the buzz words are encapsulation and loose coupling
-
Why do you need 2 directories? Store each file name in its own variable: $target_path = "uploads/"; $fileName1 = $_FILES['selectedfile']['name']; $fileName2 = $_FILES['selectedfile2']['name']; $target_path1 = $target_path . $fileName1; $target_path2 = $target_path . $fileName2; if(move_uploaded_file($_FILES['selectedfile']['tmp_name'], $target_path1)) { echo "The file ". $fileName1 . " has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; } if(move_uploaded_file($_FILES['selectedfile2']['tmp_name'], $target_path2)) { echo "The file ". $fileName2 ." has been uploaded"; } else { echo "There was an error uploading the file, please try again!"; }
-
Because that is what you are telling it to name the file in this line: $target_path = $target_path . basename( $_FILES['selectedfile']['name']) .basename( $_FILES['selectedfile2']['name']); In both file uploads, you are saving to the same path, therefore overwriting the first file upload.
-
I will try to simplify this for you. These lines are of significance: $str = "hEllo WoRld!"; capitalize( $str ); echo $str; The source of the parameter sent to the function "capitalize" is $str = "hEllo WoRld!"; If the source $str was not passed to the function by reference, when you output $str it would remain "hEllo WoRld" since only a copy local to the function will be changed and not the source. However since you are passing the source to the function by reference, the source $str changes as well. In this particular case when you output $str you will get "HELLO WORLD".
-
Please post the relevant code that you have so far.
-
$num_arr = array(100.1111, 200.2222, 300.3333); foreach($num_arr as $number) { number_format($number, 2); } this will round every element in the array to the nearest thousandth.
-
Converting Values Inside An Array Into A String
AyKay47 replied to pioneerx01's topic in PHP Coding Help
Not sure on your logic here. Is list() what you are looking for? -
Can You Echo A $Var That Is Defined Later On In The Script?
AyKay47 replied to icthos's topic in PHP Coding Help
Using global is never a valid solution. -
Record How Many Customer Register In A Day Or Month
AyKay47 replied to thelee's topic in PHP Coding Help
The above code does not show us the table structure for registrations. -
Record How Many Customer Register In A Day Or Month
AyKay47 replied to thelee's topic in PHP Coding Help
No, what does your table structure look like? -
Is There Anything Wrong With This Script?
AyKay47 replied to ddanielsmith07's topic in PHP Coding Help
No, you don't. However either method will work, bit of a habit for myself to use checksums since they have other advantages as well. What we can both agree on here is that relying on a submit button value may cause problems in some browsers. -
Is There Anything Wrong With This Script?
AyKay47 replied to ddanielsmith07's topic in PHP Coding Help
Or use a hidden checksum.. -
To point you in the right direction, look into using jQuery's AJAX API
-
In order to help you, you will need to show us the form you are using and the relevant back-end code to go along with the form.
-
Here's a simple example for you (untested): $patterns = array('~((?:http|ftp)://(?:www)?\.[^.]+\.(?:com|org|gov))~i', '~(?<!http://)(www)\.([^.]+)\.(com|org|gov)~i'); $replace = array('<a href="$1">$1</a>', '<a href="http://$1.$2.$3">http://$1.$2.$3</a>'); $filtered_string = preg_replace($patterns, $replace, $text); The regex patterns will match 2 situations, the first will match URL's that begin with http:// or ftp:// and may possibly include www. The second will match URL's that begin with www and are not preceded by http://, it will then add http:// to the beginning of the URL to make it a valid external link.
-
I'm having a hard time following the logic in your code, please give a detailed description of what exactly you are trying to do.
-
http:// is needed in links so that they are external, otherwise they will point internally which is not what we want. What you can do is write another regex that looks for www and replaces it with http://www
-
It should read htmlentities() instead of htmlentities(]
-
Display Records By Newly Added Or Updated How?
AyKay47 replied to lovephp's topic in PHP Coding Help
Didn't see that you had already provided the correct answer, I didn't see that there was a second page to this thread. Doh! Also didn't notice the spelling. double Doh! It's early... -
You will need to provide a better explanation and example for us to be able to help you. The example provided is incorrect on many different levels.