Jump to content
php.lv forumi

čats savienojumā ar ipb


Puika1

Recommended Posts

Ne baigais sviests! Var kads iedot gatavu ipb useriem saistitu catu, nevajag tur nekadu pro bet tikai users on chat un rakstit kur var! :)

 

Lukur sanāca ka paliek tikai divas kļūdas bet tas es nesaprotu! :(

<?php
$host = "localhost"; // db hosts
$dbname = "jzvac"; // foruma datubaze
$dbuser = "jzvac"; // foruma db users
$dbpass = "1991"; // juusu foruma datubaazes parole
$link = mysql_connect($host, $dbuser, $dbpass)
or die("NEsanaaca piekontektities: " . mysql_error());
mysql_select_db($dbname) or die("Datubaaze neekstistee");
mysql_select_db("jzvac_db");
$rez=mysql_query("SELECT * FROM tabula ORDER BY lauks");
while($r=mysql_fetch_array($rez)) {
echo $r['lauks'];
}

$selekts=mysql_query("SELECT * FROM ibf_sessions WHERE member_id=".$_COOKIE['member_id']);
while($r=mysql_fetch_array($selekts)) {
if(isset($_POST['ierakstiit'])) {
$ieraksts=$_POST['ieraksts'];
$laiks=time();
$membera_niks=$r['member_name'];
mysql_query("INSERT INTO chats (ieraksts, laiks, niks) VALUES ('$ieraksts','$laiks','$membera_niks')");
}
}
//Shaadu paarbaudi silti neiesaku lietot :)
if($_COOKIE['member_id'] > 0) {
echo '
<form action="" method="post">
<input type="text" name="ieraksts" />
<input type="submit" name="ierakstiit" />
</form>
';
}
//Un visbeidzot pats selekts
$dati=mysql_query("SELECT * FROM chats ORDER BY laiks DESC");
while($er=mysql_fetch_array($dati)) {
echo $er['niks']."<br />".$er['ieraksts']."<br />";
}
?>

 

Kļūdas...

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/sms.php on line 11

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home2/jzvac/public_html/sms.php on line 35

Edited by Snaip3Rs
Link to comment
Share on other sites

man sanaca bet vai kads var pateikt kā pie šī pielikt lai tikai ipb lietotāji varētu rakstīt kechum lūdzu izpalīdzi!

 

		$file = "shouts.txt"; // Name of the file which
						   // contains the shouts
	 $shouts = 4; // Number of shouts to be displayed
	 $maxlength_name = "20"; // Maximum length of name
	 $maxlength_text = "150"; // Maximum length of text
	 $break_name = "15"; // Break name after characters
						 // without space
	 $break_text = "15"; // Break text after characters
						 // without space
?>
<p>
 <form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="post">
<input type="text" value="" name="input_name" maxlength="<?php echo $maxlength_name; ?>" onfocus="if(this.value==''){this.value='';}" onblur="if(this.value==''){this.value='Your name';}" /><br />
<input type="text" value="" name="input_text" maxlength="<?php echo $maxlength_text; ?>" onfocus="if(this.value==''){this.value='';}" onblur="if(this.value==''){this.value='Your text';}" /><br />
<input type="submit" value="Sūtīt" />
 </form>
</p>

Edited by Snaip3Rs
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...