The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Stuck on an INSERT..
I feel really dumb for asking this.
I'm still fairly new to coding in PHP so I'm a little confused here: Simply put, I'm trying to insert data into a table from a simple form but I can't get it to work. I've tried everything I can think of and I still don't understand.. Can anyone see an obvious error in the code? Also, when sending the form an error popup tells me the following: (even when linking to member.php?u=$userinfo[userid]) Quote:
PHP Code:
HTML Code:
<form action="member.php" method="post"> <input type="hidden" name="do" value="insertnewcomment" /> <input type="hidden" name="userid" /> <input type="hidden" name="postedbyid" /> <input type="hidden" name="s" value="$session[sessionhash]" /> <input class="bginput" type="text" name="title" size="45" maxlength="80" /><br /> <input class="bginput" type="text" name="comment" size="45" maxlength="80" /><br /> <input type="submit" class="button" value="Submit" accesskey="s" /> </form> |
#2
|
|||
|
|||
PHP Code:
Also you are globalizing $comment as an integer, but i think you want it to be text. So either change the globalize to STR, or remove the quotes and the mysql_escape_string. |
#3
|
||||
|
||||
Hmm. Thanks Marco.
I changed the line, and added "STR" instead of "INT" but I still can't seem to get it to enter into the database. Perhaps it has something to do with this? Quote:
Thanks for your help. |
#4
|
|||
|
|||
Are you using 3.5.0? I'm editing member.php(For 3.0.7) ATM too, and I used $userid to get the userid of the member's profile currently been viewed, and it worked.
|
#5
|
||||
|
||||
Nope, 3.0.7
Sorry, I should have specified that before. Are you meaning: HTML Code:
<form action="member.php?u=$userid" method="post">
I'll post a screen: It's giving me the error message, but the user id clearly does exist.. just kind of weird. |
#6
|
|||
|
|||
When you go to http://www.yoursite.com/member.php?u=1, does that bring you to a profile? Or do you get the same error message?
|
#7
|
||||
|
||||
When I go directly there it gives me the profile. What's weird is when I have that error message, I click "Go" in the browser and it loads the profile just fine.
|
#8
|
|||
|
|||
Oh and to get the query to run try
PHP Code:
|
#9
|
||||
|
||||
Dang, no deal. Still doesn't enter into the database, and still getting this strange redirect error. Thanks for the help though guys, I'm not sure if I'd have any hair left if I didn't get help on some things.
|
#10
|
|||
|
|||
Hmm i am no HTML guru, but i don't think you can pass variables with the 'form action=...'.
You should use a hidden input field to pass those variables. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|