![]() |
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......................... |cry| |
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. |
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. |
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. |
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. |
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. - |
oops, I should have refreshed before posting :)
|
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.:D |
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 :)
|
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. :) |
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 |
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. |
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/ |
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! |
All times are GMT -4. The time now is 09:04 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc