Page: [1] [2] |
Archamond
Statusless? Maybe Send PM
Posts: 1825
Threads: 123 Mood: meh Money: £422.09 (D) User Tax: 5% (+ Friend)
|
Ofcourse, this is not porn
i have some troubles in php
i cant upload things to database(mySQL)
this is full code:
\n
<?PHP\n<?
include("CONTROL1.php");
?>
<br />
<?
if(!$_POST['submit'])
{
?>
<h3>Post your comments here:</h3>
<form method="POST" action="chat.php">
<table>
<tr><br />
<td>Your name</td>
<td><input name="name" length="10" maxlength="30"></td><br />
</tr>
<tr>
<td>What you want to say</td>
<td><textarea name="text" height=20 width=500></textarea></td>
</tr>
<tr>
<td>Your e-mail adress</td><br />
<td><input name="email" length="255" maxlength="255"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="submit" value="Post Here!"><br />
</td>
</tr>
</table>
</form>
<?
}
else
{<br />
?>
<?
function myerror() {
echo mysql_error();
exit();
}
$connection = mysql_connect("localhost", "root", "") or myerror("Invalid server or user");
mysql_select_db("archcomdaba", $connection);<br />
$query = "insert into
chat(name,text,email)
values('$name','$text','$email')";<br />
$result = mysql_query($query,$connection) or myerror("Error in query");<br />
?>
<center><h3>Your comments are now added to database</h3></center>
<br />
<?
}
?>
<?
include("CONTROL2.php");
<br />
?>\n?>
\n
on database, it saves empty field, no matter i write into boxes
is something wrong in code or anything else........
please help
|
06.05.04 15:05 Post #1 | [ArchamondCOM ] [Hide Sig (20)] [Profile] [Quote] |
Dingbats
; Send PM
Posts: 1970
Threads: 50 Mood: Optative Money: £268.57 (D) (+ Friend)
|
I'm not too sure, since I'm not that good at PHP myself, but I think that \n values('$name','$text','$email') \n should be \n values($name,$text,$email) \n. Again, I'm not sure.
|
06.05.04 17:59 Post #2 | [Softbrain Games] [Hide Sig (2)] [Profile] [Quote] |
C1
Looking For Status Send PM Posts: 0
Threads: 0 Money: £0.18 (D) (+ Friend)
|
I'm not too sure, since I'm not that good at PHP myself, but I think that \n values('$name','$text','$email') \n should be \n values($name,$text,$email) \n. Again, I'm not sure.
No that's fine. I use the ' in my code as well.
|
06.05.04 19:41 Post #3 | [Hide Sig (2)] [Profile] [Quote] |
tundraH
Statusless Send PM Posts: 566
Threads: 20 Money: £1.26 (D) (+ Friend)
|
Is register globals on?
|
06.05.04 20:14 Post #4 | [tundraH.com] [Hide Sig (0)] [Profile] [Quote] |
Zogger!
Looking For Status Send PM Posts: 3954
Threads: 62 Money: £93.82 (D) (+ Friend)
|
I believe it is, when I was talking to him about it. Didn't seem to make any difference... (that's the "use variables as globals" option in phpconf btw, arch)
________________
You know I'm a dancing machine |
07.05.04 14:57 Post #5 | [Hide Sig (8)] [Profile] [Quote] |
Archamond
Statusless? Maybe Send PM
Posts: 1825
Threads: 123 Mood: meh Money: £422.09 (D) User Tax: 5% (+ Friend)
|
Ofcourse, this is not porn
i tried things that you say Ding
doesnt work
i think that it dont create those varibles
|
10.05.04 19:50 Post #6 | [ArchamondCOM ] [Hide Sig (20)] [Profile] [Quote] |
Dingbats
; Send PM
Posts: 1970
Threads: 50 Mood: Optative Money: £268.57 (D) (+ Friend)
|
\n "values('$name','$text','$email')" \n
Should be:
\n "values('".$name."','".$text."','".$email."')" \n
That works for me.
|
11.05.04 16:44 Post #7 | Last edited: 11.05.04 16:46 (Dingbats - 2 times) |
[Softbrain Games] [Hide Sig (2)] [Profile] [Quote] |
Archamond
Statusless? Maybe Send PM
Posts: 1825
Threads: 123 Mood: meh Money: £422.09 (D) User Tax: 5% (+ Friend)
|
Ofcourse, this is not porn
i'll try
|
11.05.04 16:47 Post #8 | [ArchamondCOM ] [Hide Sig (20)] [Profile] [Quote] |
Archamond
Statusless? Maybe Send PM
Posts: 1825
Threads: 123 Mood: meh Money: £422.09 (D) User Tax: 5% (+ Friend)
|
Ofcourse, this is not porn
DOESNT WORK
something sucks on my PC for sure
|
15.05.04 15:47 Post #9 | [ArchamondCOM ] [Hide Sig (20)] [Profile] [Quote] |
Dingbats
; Send PM
Posts: 1970
Threads: 50 Mood: Optative Money: £268.57 (D) (+ Friend)
|
Weird. It works perfectly well for me that way.
It may just be your browser that has cached the file when it didn't work. That happened to me one time. If that is the case, just rename the file.
|
15.05.04 16:35 Post #10 | [Softbrain Games] [Hide Sig (2)] [Profile] [Quote] |
tundraH
Statusless Send PM Posts: 566
Threads: 20 Money: £1.26 (D) (+ Friend)
|
Three suggestions:
- Replace $name with {$_GET['name']}
- Post a table dump from phpMyAdmin if you can.
- Add echo mysql_error(); to the end.
|
15.05.04 20:05 Post #11 | [tundraH.com] [Hide Sig (0)] [Profile] [Quote] |
Zogger!
Looking For Status Send PM Posts: 3954
Threads: 62 Money: £93.82 (D) (+ Friend)
|
- Add echo mysql_error(); to the end.
that's what the myerror function does
________________
You know I'm a dancing machine |
15.05.04 20:45 Post #12 | [Hide Sig (8)] [Profile] [Quote] |
MrrLL
Statusless Send PM Posts: 2
Threads: 0 Money: £5.34 (D) (+ Friend)
|
meh, i dont understand any of that mumble jumble lol
|
16.05.04 00:22 Post #13 | [Hide Sig (5)] [Profile] [Quote] |
Archamond
Statusless? Maybe Send PM
Posts: 1825
Threads: 123 Mood: meh Money: £422.09 (D) User Tax: 5% (+ Friend)
|
Ofcourse, this is not porn
than dont post
It may just be your browser that has cached the file when it didn't work. That happened to me one time. If that is the case, just rename the file.
browser?
i dont think so
i check is somethig written in mySQL database, i will add code to page when i make it work
|
16.05.04 14:35 Post #14 | [ArchamondCOM ] [Hide Sig (20)] [Profile] [Quote] |
Dingbats
; Send PM
Posts: 1970
Threads: 50 Mood: Optative Money: £268.57 (D) (+ Friend)
|
What error messages do you get?
|
18.05.04 17:28 Post #15 | [Softbrain Games] [Hide Sig (2)] [Profile] [Quote] |
Page: [1] [2] |
Your Comments: