AyKay47
Members-
Posts
3,281 -
Joined
-
Last visited
-
Days Won
1
Everything posted by AyKay47
-
bottom line. if($HourOn == $HourOn || $MinuteOn > $MinuteOn) makes no sense, what are you trying to achieve here?
-
i believe this is because immedietaly following your declaration of car[0] you have the line date[0]="20/12/2011"; which will trip an error and render any code after this line useless, due to the fact that you haven't declared the variable date before attempting to use it, as gristoi said. perhaps you meant to declare date instead of home.
-
Need feedback on design and color selection
AyKay47 replied to sandeep529's topic in Beta Test Your Stuff!
seems to work, could probably be a little more creative with the design. What is the point of this website exactly? -
there is more than likely output somewhere else in your code, nothing is wrong with your echo statement, please post the relevant code.
-
Is there a way to remove scripts from a string?
AyKay47 replied to simboski19's topic in PHP Coding Help
the concerns with security and databases are the user input of course. If you sanitize the user input before insertion and upon output correctly, you will not have any issues. -
what value is stored in your date field?
-
the mysql function CURDATE() returns the date in the format of YYYY-MM-DD' or YYYYMMDD depending on whether it is used in string or numeric context. you will need to match that format with your date() function in order for the query to grab the correct row.
-
what do you mean exactly?
-
as it is meant for classes
-
yes in order for this to work correctly and to avoid some ugly coding, both your button and your hidden div should be included in the same parent div.
-
Is there a way to remove scripts from a string?
AyKay47 replied to simboski19's topic in PHP Coding Help
you bring up a good point with the mysql memory usage, very true. let me amend my statement then. perhaps for insertion simply mysql_real_escape_string should be used, and upon output something like htmlspecialchars would be good here, as Adam said as well. -
$query = "SELECT * FROM Message WHERE `Status` = 'No'"; $numresults=mysql_query($query); if (mysql_num_rows($numresults) == 0) { //no results with status = no $message = 'Pas de Message: ' . mysql_error() . "\n"; die($message); } else //status found equal to no { echo "<h1>1 message</h1>"; echo "<embed src =\"$file\" hidden=\"true\" autostart=\"true\"></embed>"; }
-
Is there a way to remove scripts from a string?
AyKay47 replied to simboski19's topic in PHP Coding Help
didn't know that you were using it for this purpose. the best method for sanitizing a user input string in my opinion is to escape the special characters beofre inserting the string into your db.. this will disallow sql injection xss etc. you can use filter_var and specify the filter to your liking.. or you can use a combination of htmlspecialchars and mysql_real_escape_string, or really you can also use a regex to either disallow specific special chars, or remove them completely, however the ladder choice isn't very user friendly. Depends on what your logic for this is. -
Is there a way to remove scripts from a string?
AyKay47 replied to simboski19's topic in PHP Coding Help
not the prettiest regex, threw it together in a minute, but it's tested. <?php $string = "some text <script> functionhere(); </script> some more text"; $regex = "/<.+>[a-zA-Z0-9]+<\/[a-zA-Z0-9]+>/"; $string = preg_replace($regex,'',$string); echo $string; ?> -
it looks like you are checking if the incremented number is an even number, if that is the case.. the modulus operator will return 0 since their is not remainder. if(++$rowNum % 2 == 0 ) { //even number
-
are you using a singular class for your hidden div? you will want to use unique id's for this and associate each button id with the correct div id. and I recommend using .each as well.
-
Is there a way to remove scripts from a string?
AyKay47 replied to simboski19's topic in PHP Coding Help
don't know of any built in PHP functions that can do this off the top of my head. as strip_tags() will only remove the tag itself and not the content.. you will probably want to use regex for this with preg_replace -
silly error, had to give the parent directory executable permission for the group
-
I am having an issues incorporating the SWFUpload object into my website. I have everything set up correctly as far as instantiation is concerned and defining the required parameters. The flash object appears as it should, the height and width parameters work, however the button_image_url parameter does not. Nothing appears but a white box where the flash object is. When I click on it nothing happens, nor is the button_text parameter displayed. When I view the console log in chrome, It is telling me that it is making a GET request to the .swf file as it should, however it is returning a 403 forbidden error while attempting to retrieve the file, which I believe to be the root of my problems. Can't seem to figure out why it is not able to access the swf file as it should be. I have checked the file permissions and they are as they should be. Thank You
-
yes that should send the correct email, accept wrap your indices in single quotes instead of double quotes, they way you have it now it will break the line prematurely and cause errors.
-
what i see in the error is the file that she searched for, and the file returning the error.
-
meant to write ../ i also was to believe that / points to the root directory, however her results state otherwise, unless the directory that she is trying to call is not in the root directory, however from the data given, it appears that it is.
-
in that case.. you can most likely compare the count of the original array, and the count of the new array after using array_unique. If the 2 counts are equal, then there are no duplicates and you should proceed with the rest of your code, else, return an error.
-
what exactly do you want to do to duplicate values? if you want to remove them, whereas only one of the duplicate values will be present, you can use array_unique. Otherwise, it will get a little more in depth. Edit: Pika beat me to it.
-
the "/" is pointing to the base of the directory that the calling page is in, in this case it would be calling the "pages" directory. your can use ./ to go back a directory from the one your are in now. ?php require_once('./components/body_footer.inc.php'); ?>