
MDCode
Members-
Posts
640 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MDCode
-
No, then you are risking javascript being used. You need to replace specific tags only. Example: <?php // $_POST['sometext'] will be <h1>Title</h1><p>Some paragraph</p><script>alert(hi)</script> $original_text = htmlentities($_POST['sometext']); // The htmlentitied tags (< being < and > being >) $converted = array('<p>', '</p>', '<h1>', '</h1>'); // What to replace them with $tags = array('<p>', '</p>', '<h1>', '</h1>'); // Use str_replace to make things so much simpler $new_stuff = str_replace($converted, $tags, $original_text); echo $new_stuff; ?> $new_stuff will display Title as an h1 header and the paragraph but will convert the script tags so they won't work
-
Selecting from it getting the row and assigning it to a variable.
-
No. I don't believe you can post a variable. Even if you can you have it in single quotes which will not parse it's value
-
Have you tried echoing mysql_error() ?
-
"I am struggling" does not define your problem? What is it doing that it shouldn't, or what is it not doing that is should?
-
htmlspecialchars and htmlentities will both convert the less than and greater than. You will need to str_replace all of the tags back into your data
-
You are letting users query your database? Aren't you a bit concerned that there are security issues? As for your problem I can not understand one bit of your description.
-
While Loop (Defining Variable And Conducting Another While Loop)
MDCode replied to Clinton's topic in PHP Coding Help
If you want to select from multiple tables, you need to use a join. It's not good to use queries in loops. -
I see no errors with that code block. Paste the whole page in tags
-
Mysql_Num_Rows($Result) Not Working As Expected, Need Advise.
MDCode replied to equivalents's topic in PHP Coding Help
You can not use mysql commands with mysqli. It will not work. Choose one. -
Pagination Working With Multiple Variables [Split From Existing Thread]
MDCode replied to geezz's topic in PHP Coding Help
http://yourdomain.com/yourfile.php?province=whatever&city=blah&k=k&t=rawr -
Pagination Working With Multiple Variables [Split From Existing Thread]
MDCode replied to geezz's topic in PHP Coding Help
If they are not defined in the url, it would explain it. I've tested it on my site with no errors. -
Pagination Working With Multiple Variables [Split From Existing Thread]
MDCode replied to geezz's topic in PHP Coding Help
Please do not post an issue in another person's topic. You first query should work except you misspelled a variable -
deleted
-
Perhaps they changed settings, change your opening <? tag to <?php
-
Remove the quotations like you did with $_POST['subject'];
-
Yes, you are looking for $_POST['subject'] not $subject. Change all those ($subject, $detail, $customer_mail).
-
If this is a php issue it should not matter which country. Do you have a question other than what seems to be "Can you please go to my website?"
-
If that is where your form and processing code is located yes.
-
Well, we need to see your form and your full page of code if you haven't posted it already. I think what you might be looking for is $_POST['subject'], $_POST['detail'], etc.
-
I found it much easier to learn python after I got a good grasp on php. My opinion is that you should go with php first.
-
You're calling a variable by a variable that isn't defined. Of course it's going to give an undefined notice.
-
You can use cookies (which can be cleared) or use a database.
-
Force Users To Type Specific Word In Php Form
MDCode replied to beelzebomb's topic in PHP Coding Help
Look into google ReCaptcha. We are not here to code for you, we are here to help you.