PDA

View Full Version : I need to know this..


zardos
04-12-2007, 09:21 AM
Hi, i need to knew how to do this, casus if i learn how, I have gotten my self samples for almost everything i need know to start creating my own mods. So please help me.

I want to have en example on how to write something in a form, then it submit and the info inserts into the database. some ting like this but in vBulletin code.

<textarea name="info" cols="100" rows="10" id="info"></textarea>
<input type="submit" name="Submit" value="Submit">

if (isset($_POST['Submit'])) {

$info = $_POST['info'];


$save = "INSERT INTO db(info) VALUES ('$info')";
mysql_query($save) or die("error");

exit;

}



Please help me..

Dismounted
04-12-2007, 11:17 AM
Clean your variables using the vBulletin Input Cleaner (Search Articles) and use the vBulletin Database functions.
$result = $vbulletin->db->query_read("QUERY");
$result = $vbulletin->db->query_first("QUERY");
$result = $vbulletin->db->fetch_array($result);
$vbulletin->query_write("QUERY");
There are many more, but those are the most common used ones.

zardos
04-12-2007, 01:07 PM
You don't have some code laying round that i can take a look at? I need to see boath the template code and the VB code?

Dismounted
04-13-2007, 05:18 AM
Look through the 3.6.x hacks...There are heaps.