|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
![]() |
#1 |
Certified Nice Person
|
Putting HTML in a form on a PHP page to submit to a mySQL db
Ok, here's the thingy. I used to be able to insert HTML tables and such into my form so that it would insert it into my database and eventually get pulled onto my templates. Now I can't. I can submit the brackets <> by themselves without space between them without a problem, but if a character or space is separates them, I get an Internal Server Error.
Could this be some software variable on my server that is causing this? I'm thinking that this error started when I moved from my virtual account onto a dedicated server. Perhaps something on the php.ini? Help......................... ![]()
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
#2 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
You probably had safe quoting on the old server, and it is off on the new server.
Personally, rather than adjust the new default (which is safer), you might want to adjust your methods for processing input to avoid SQL injection. I'm surprised it is a space that is causing the problem and not something like a " or a ' you might wrap your variables with addslashes() and see if that is indeed the problem. otherwise, try printing the actual query that is being executed, and cut and paste it into mysql's command line interface or phpmyadmin to see what is actually breaking.
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#3 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
What is a good book to buy for the MySQL challenged? I've bought a few books on php that talked about MySQL but that is about it.
Mostly I want to better understand writing queries when I'm in PhpMyAdmin doing search and replace, deletes, etc. Something for a user not someone writing code. |
![]() |
![]() |
![]() |
#4 |
a.k.a. Sparky
Join Date: Sep 2004
Location: West Palm Beach, FL, USA
Posts: 2,396
|
Personally, I find the source code to be an invaluable reference for working with mysql.
As for a book, I bought one of my guys, the MySQL Administrator Guide, http://www.amazon.com/exec/obidos/tg...l/-/0672326345 (affiliate code stripped off) It was one of the few that went indepth into a few issues that were quite important (indexes & joins), but, might be a tough read and perhaps not really for general use/consumption. There was another one that I saw at the bookstore, Beginning Mysql from Novice to Professional. I flipped through the pages, it was a much more cursory overview, and seemed written well. I used to be a fan of the Zoo books (O'Reilly), but, lately, their content quality seems to have gone downhill. My personal preference is always a reference style book, some people prefer tutorial type books. If I get a chance this weekend, I'll go to the bookstore and read through a few.
__________________
SnapReplay.com a different way to share photos - iPhone & Android |
![]() |
![]() |
![]() |
#5 |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
MySQL Administrator Guide seems like it would be a bit much.
I get the VIsual Quickstart Guide by Peachpit press for just about everything but I haven't looked what they have for MySQL. Luna is coming over this afternoon and since she also likes bookstores maybe the two of us will go over to Borders and see what they have. |
![]() |
![]() |
![]() |
#6 | |
You tried your best and you failed miserably. The lesson is 'never try'
Join Date: Oct 2004
Posts: 166
|
Quote:
I bought it at Barnes & Noble for 45.00. I would suggest checking out one of the local book stores so you can thumb through pages and see if the book has what your looking for. In this book the example website is a wine store. Really nice examples on how to use MySQL calls. - |
|
![]() |
![]() |
![]() |
#7 |
You tried your best and you failed miserably. The lesson is 'never try'
Join Date: Oct 2004
Posts: 166
|
oops, I should have refreshed before posting
![]() |
![]() |
![]() |
![]() |
#8 |
Certified Nice Person
|
This is the one I have. http://www.amazon.com/exec/obidos/AS...229078-5441724
I've successfully wreaked havoc on many fine scripts with it. ![]()
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
#9 |
You can now put whatever you want in this space :)
Join Date: Aug 2003
Location: GA
Posts: 598
|
I've got (amongst others) 'PHP and MySQL Web Development' by Luke Welling and Laura Thomson. It's very thick so it must be good
![]()
__________________
Out of date sig! |
![]() |
![]() |
![]() |
#10 | |
Subversive filth of the hedonistic decadent West
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
|
Quote:
They are good stuff. I stopped using the 6 inches of manuals that came with Final Cut Pro after getting the Visual Quckpro Guide for it. Going to check out PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide later today. ![]() |
|
![]() |
![]() |
![]() |
#11 | |
Wheither you think you can or you think you can't, Your right.
|
Quote:
I also get a ton of help on the forums, sitepoint is an excellent resource. I always get a answer and usually quite quickly. ronnie |
|
![]() |
![]() |
![]() |
#12 | |
No offence Apu, but when they were handing out religions you must have been out taking a whizz
|
Quote:
htmlentities($_POST['form_field'], ENT_QUOTES); When you are pulling the data out of the database to insert into your templates use: html_entity_decode($query->field, ENT_QUOTES); // assuming you are using mysql_fetch_object() to retrieve your query data.
__________________
Please Re-Read The Rules For Sig Files |
|
![]() |
![]() |
![]() |
#13 |
WHO IS FONZY!?! Don't they teach you anything at school?
|
A good thing that we used to subscribe to was O'reilly's safari - where they publish all of their books online in a searchable format. You pay a subscription each month and can have a number of books on your "bookshelf" at one time. They give you a free 14 day trial and it could be worth a look as you get the whole books online and if you prefer reading proper books you can always buy the book if it's useful.
http://safari.oreilly.com/
__________________
BBW modelling competitions |
![]() |
![]() |
![]() |
#14 |
Certified Nice Person
|
Son of a bitch!
Whatever setting I have on this server that isn't allowing my little form to work is also keeping me from using any type of code on my blog entries. Son of a bitch!
__________________
Click here to purchase a bridge I'm selling. |
![]() |
![]() |
![]() |
|
|