Database Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesDatabase Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
You eat, breathe and sleep innovation. Build your mobile intelligence with BlackBerry® experts this July. Register Today!
  #1  
Old June 5th, 2003, 11:12 PM
martindom martindom is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: West Plains, Mo. U.S.
Posts: 16 martindom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to martindom
db connect and not posting

I am working on a redhat server. I am having trouble with sending data from a form to the database. As I am a code baby I think it is simple for someone else.

my form:
<h4>

<form method="post" action="resa.php" enctype="multipart/form-data" onSubmit="return checkit(this)">
<h4> E MAIL ADDRESS:<br><input type="text" Name="email" SIZE="50" STYLE="background:00bfff" VALUE="Your email is required" INPUT TITLE="your email"><br><br>
NAME:<br><INPUT TYPE="TEXT" NAME="name" SIZE="50" WRAP="virtual" STYLE="background:00bfff" STYLE="color:000000" VALUE="YOUR NAME" INPUT TITLE="your name" ><br>
Description:<br><INPUT TYPE="TEXT" NAME="description" SIZE="75" WRAP="virtual" STYLE="background:00bfff" STYLE="color:000000" VALUE="describe research" INPUT TITLE="topic of research" ><br>
Keywords:<br><TEXTAREA NAME="keywords" COLS="67" ROWS="5" WRAP="virtual" STYLE="background:00bfff" STYLE="color:000000" VALUE="keywords" INPUT TITLE="keywords for the search"></textarea> <P>
Research:<br><TEXTAREA NAME="research" COLS="67" ROWS="50" WRAP="virtual" STYLE="background:00bfff" STYLE="color:000000" VALUE="research" INPUT TITLE="paste your research here"></textarea> <P>
<input type="submit">


</form>
</h4>

The external file resa.php is:


<?



mysql_connect (localhost);
mysql_select_db (test);

mysql_query ("INSERT INTO resa
(name,email,description,keywords,research)
values('$_get[name]','$_get[email]','$_get[description]','$_get[keywords]','$_get[research]')
");
foreach($HTTP_POST_VARS as $keys=>$values){
${$keys}=$values;
echo "<p>Research from $name at $email was added to the database</p>";


?>

when submitted I receive the echo. I however do not get any data in the database. By command line select * from db shows empty.

Can anyone help?

thank you in advance.

martindom

Reply With Quote
  #2  
Old June 6th, 2003, 01:08 AM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: db connect and not posting

see if this works...
php Code:
Original - php Code
  1.  
  2. $link=mysql_connect ("localhost" "mysql_user", "mysql_password")or die("Could not connect: " . mysql_error());
  3. mysql_select_db ("test",$link);
  4.  
  5. $result = mysql_query ("INSERT INTO resa
  6. (name,email,description,keywords,research)
  7. values('$_POST[name]','$_POST[email]','$_POST[description]','$_POST[keywords]','$_POST[research]')
  8. ");


remember to replace 'mysql_user' and 'mysql_password' with your own username & password

Reply With Quote
  #3  
Old June 6th, 2003, 06:18 AM
martindom martindom is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: West Plains, Mo. U.S.
Posts: 16 martindom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via Yahoo to martindom
RE: db connect and not posting

Thanks blindeddie! That worked. I really do appriciate the help. Is there a way to put line breaks in the text put in a text area? If not it will still work just makes it more confusing when the public has to read long strings without breaks. Thank you again. Martindom

Reply With Quote
  #4  
Old June 6th, 2003, 06:12 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: db connect and not posting

in the textarea tag put thr following:

WRAP=VIRTUAL

so it would look like

<TEXTAREA WRAP=VIRTUAL>

that should wrap the text in the textbox.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesDatabase Help > db connect and not posting


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway