When I Insert Into Database How Can I Not Allow Tags? <Td> And
Posted 23 December 2012 - 08:49 AM
I understand the post, and how to insert, but how do I check that no tags where wrote in?
This is a ok inseart
<td>this is not a ok insert</td>
or any other tag
Posted 23 December 2012 - 10:07 AM
Clearly, what do you want to do here. How do you try to insert data into the database?
Posted 23 December 2012 - 11:43 AM
strip_tags (), as the latter function have some caveats that might very well end up messing up/preventing your users from submitting legit content. Primarily this is because of something just looks like it might be a HTML tag,
strip_tags ()will remove it. So anything starting with a < is subject to removal, even if it's not properly closed.
Edited by Christian F., 23 December 2012 - 11:43 AM.
Posted 23 December 2012 - 06:49 PM
In flash i can pass strings to strings, so if this.text.string ="SOMETHING";
i can call that sting anytime i want and place it any where.
this.newtext.string =""; <--NOTHING
but if i need that to == what this.text.string is i would just do this.
can I do that in html?
Edited by Mancent, 23 December 2012 - 06:52 PM.
Posted 23 December 2012 - 08:20 PM
In case I misunderstood and you wanna set this.text.string to this.newtext.string it is as simple as $string1=$string2
All of that is done in PHP, html cannot compile logic, only elements which are going to be displayed on the page ( well not only but basically )
Edited by Manixat, 23 December 2012 - 08:20 PM.
Posted 23 December 2012 - 08:46 PM
Posted 23 December 2012 - 09:16 PM
Then you can do
print_r($_GET) to see what it contains, every value that has been set in this or the $_POST array can be modified
Edited by Manixat, 23 December 2012 - 09:21 PM.
Posted 23 December 2012 - 09:35 PM
It should be noted that while the examples in the PHP manual use the
globalkeyword, and the
$_GLOBALSsuperglobal, you should use neither. Instead you should pass the variables as parameters to the functions, and use
returnto get the data back from a function.
Also, since you seem to be mixing PHP and HTML, it can be advantageous to think about PHP as the logic layer, and HTML as the presentation layer. HTML itself doesn't do any logic, as Manixat stated above, it only displays static content. PHP, on the other hand, is executed on the server and generates the HTML content that is sent to the client. Separate those (as well as JS and MySQL, if you use them) from each other and things will be a lot easier to handle.
Edited by Christian F., 23 December 2012 - 09:35 PM.
Posted 24 December 2012 - 02:53 AM
Im trying to do a simple hide and show. with as2 its objectsname._visible=true; or false;
What i am trying to do is, hide the upload button until the file is selected, once it is selected, then we see the upload button. Its something simple and it seems so hard!
Edited by Mancent, 24 December 2012 - 02:58 AM.
Posted 29 December 2012 - 12:16 PM
<input id ="selectfile" onchange="show button function here" type="file" name="x" accept="image/*"/>
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users