Jump to content

Recommended Posts

Posted

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

(B) 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

You could use jQuery to load some of that data via ajax.

Posted
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?

 

 

Posted

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');

  • 2 weeks later...
Posted

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?

 

Posted

Probably the column storing your PLOT is too small; what type is it, varchar or text?

Posted
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.

  • 2 weeks later...
Posted
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?

Posted

I can't think of any reason why it would fail when you copied text.

Posted
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?

 

 

Posted

Try removing the linefeeds in your PHP code, then see if it works.

Posted
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']) . " ...";

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...