简体   繁体   中英

PHP/MySQL Friend Request System

I am trying to use the php code found here: http://www.thetechideas.com/how-to-make-friendship-request-system-in-php/

And I am encountering a WHOLE lot of errors, I'm not sure why. I think it might have something to do with their question marks and apostrophes but I'm not sure.

I've made quite a few errors go away by messing with the quotation makes and apostrophes, but I am still getting errors? Does anyone know why?

Thanks!

That code is not a good example, it uses the contents of $_GET directly in SQL statements, and puts these values into the session. These are not good practices. They are terribly insecure.

All values read from the Internet should be validated and the SQL should be built using prepared statements. Doing these will make your code far more secure and will reduce the number of quotes needed to build the SQL. You should use mysqli or better yes PDO to allow prepared statements.

It's going to be hard to figure out exactly why this is breaking for you, but at first glance I see there are a lot of quotes, single and double, and question-marks, and I wouldn't be surprised if since you're having to dork around with those at all the encoding just isn't going to work? You may also have made mistakes editing it, too. What editor are you copying this into? If you paste it into something like eclipse instead do you you still get errors?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM