Jump to content

Bojak

Members
  • Posts

    57
  • Joined

  • Last visited

Bojak's Achievements

Member

Member (2/5)

0

Reputation

  1. certainly psycho thanks for the advice!
  2. i would love to use html purfier but at the moment i am unsure how to do that. i really want to allow hyperlinks.
  3. but if i want to post a picture from their photo album i would need to use php? i guess with a button or something.
  4. ah so just let them copy and paste? i guess htmlspecialchars would force it into plain text.
  5. im only asking because im going to be making a comment system. i dont really know how to go about it the correct way. i want the to be able to share websites in a comment.
  6. htmlspecialchars() may be fine for user names but not for user messages? because if the user post a link it would break the link?
  7. im only asking because i dont know what to put in the else bracket. because im only testing for one solution.
  8. im building a registeration form but what do i put in the else? can i put other values i want to check for different inputs? like email and password?
  9. oh that makes sense! thank you!
  10. so it should be the following example? function is_valid_username($username){ if (empty(strip_tags($username))) { echo "username is required"; } else { $username = $_POST["username"]; } }
  11. is this the correct syntax to strip tags and check if username is empty? if (strip_tags((empty($username))) { echo "username is required"; } else { $username = $_POST["username"]; } }
  12. i fixed the issue.. it was blank because there was nothing in the database but i wasnt connecting it to a database just yet. next step is to connect to a database and loop it.
  13. well it seems the issue was the beginning php tag but now its completely blank.
  14. <!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"> </script> <script language="javascript"> function toggle() { var element = document.getElementById("textMessage"); var text = document.getElementById("textSwitch"); if(element.style.display == "block") { element.style.display = "none"; text.innerHTML = "show"; } else { element.style.display = "block"; text.innerHTML = "hide"; } } </script> </script> </head> <body> <? $commentMessage = "this would be a test"; $x=1; while ($row = mysql_query($commentMessage) > $x) { echo '<a id="textSwitch" href="javascript:toggle();">show</a>'; echo '<div id="textMessage">' . $commentMessage . '<textarea></textarea></div>'; $x++; } ?> </body> </html> i want this to eventually connect to a database and loop through all the messages but for now i hard coded a message but it isnt working as i had hoped. its posting parts of the script instead of doing an echo. i attached a photo to explain more. if you could explain the issue i would be so thankful.
  15. i figured out line 33 issue. trying to figure out 24 and 26.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.