cmpadmin Posted August 5, 2011 Posted August 5, 2011 So I have started my new site. So far with a little (lot) of help from you guys I have got quite far. Its not pretty but it is almost funtional. Here is a quick recap: crazymoonpics.heliohost.org on Stevie. Site to be used as a prive IMDB type site where our productions can be listed and search upon. As I am not always around I want users to be able to add their own entries so I have created a form. Now the form works, posts to my database as does the add person button which also posts. I now have two questions I need help on. 1. If I add a person and submit that entry to the database can I make it update the select box automatically so they do not have to reload the page and lose their settings? 2. Not all entries will have 10 cast members. Minimum is 2 and max is 10. Is there a way that I can set these up to either: (a) only show when required ( select a blank option somehow so it does not post to the database If you can help me sort these things out I think all the backend will be complete then for the form and I just have to move onto presenting the data which I think will be markedly easier. Thanks to all that have helped so far, its been a brilliant learning experience. Thanks to all who hopefully help now.
Guest Geoff Posted August 5, 2011 Posted August 5, 2011 You could use jQuery to load some of that data via ajax.
cmpadmin Posted August 11, 2011 Author Posted August 11, 2011 You could use jQuery to load some of that data via ajax. I have been trying to figure out how to do this with AJax but I am struggling as I dont really know the in's and out's of JQuery or Ajax for that matter. Basically I will click the add person button which opens a separate page, add the person, click submit and the page will close. Does the Ajax portion need to go into the add person page or the page with the actual select boxes?
Guest Geoff Posted August 11, 2011 Posted August 11, 2011 This is how it will go: Use window.open to open a window. In the open window, call window.parent.myFunction when the user clicks submit. In the parent window, myFunction will close the window, then call $('#identifier').load('http://www.com/yourform.php#identifier');
cmpadmin Posted August 26, 2011 Author Posted August 26, 2011 OK new question. In my form crazymoonpics.heliohost.org/movieAdd.php I can add things into the fields no problem. However for some reason when I add a lot of text into the plot field it does not seem to save to my database. I beleive it only occurs when I copy and paste. The field in the db is setup as text but it still does not seem to save. Only when i manually type into the field. Any ideas on what I can do to resolve this?
Guest xaav Posted August 26, 2011 Posted August 26, 2011 Probably the column storing your PLOT is too small; what type is it, varchar or text?
cmpadmin Posted August 30, 2011 Author Posted August 30, 2011 Probably the column storing your PLOT is too small; what type is it, varchar or text? Hi, I have tried both options. Also when I type in it seems ok. When I copy/paste text in it fails. Unless I only copy/paste one paragraph. Then it seems to work.
cmpadmin Posted September 7, 2011 Author Posted September 7, 2011 Probably the column storing your PLOT is too small; what type is it, varchar or text? Hi, I have tried both options. Also when I type in it seems ok. When I copy/paste text in it fails. Unless I only copy/paste one paragraph. Then it seems to work. Anyone got any ideas on my little problem?
Guest xaav Posted September 7, 2011 Posted September 7, 2011 I can't think of any reason why it would fail when you copied text.
cmpadmin Posted September 8, 2011 Author Posted September 8, 2011 I can't think of any reason why it would fail when you copied text. Yeah i know its a weird one. I can copy a paragraph of text but not a lot. Is there any issues posting a textarea box to SQL when it has line breaks etc. These are long paragraphs of text which contain () and "" and the like. Should I be posting it a different way than the other fields?
Guest xaav Posted September 9, 2011 Posted September 9, 2011 Try removing the linefeeds in your PHP code, then see if it works.
pm62eg Posted September 9, 2011 Posted September 9, 2011 I can copy a paragraph of text but not a lot. Is there any issues posting a textarea box to SQL when it has line breaks etc. These are long paragraphs of text which contain () and "" and the like. Do you escape the text before sending it to the db? $sql = "insert ... " . mysql_real_escape_string($_POST['paragraph']) . " ...";
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now