-
Posts
544 -
Joined
-
Last visited
Everything posted by soimuletzu1
-
Nu pot sa il adaptez dupa scriptul care il am , am incercat cateva variante dar faza ii ca trimite mail doar la primul mail din optiunile de la <select> $to = $_POST['sender']; if (($to = "pubcs@yahoo.com") || ($to = "vanzari@area-gaming.in") || ($to = "suport@area-gaming.in") || ($to = "admin@area-gaming.in")) mail($to, $subject, $message, $headers); Iar la formular am pus: <td width="91"><label>Alege contact:</label></td> <td width="328"><select name="sender" id="sender"> <option value="pubcs@yahoo.com">Contact</option> <option value="vanzari@area-gaming.in">Vanzari</option> <option value="suport@area-gaming.in">Suport tehnic</option> <option value="admin@area-gaming.in">Administrator</option> </select></td> Nu poti te rog frumos mi-l adaptezi tu la primul script postat de mine? Is incepator in php ... acum mai mult lucrez dupa exemple. Mersi.
-
<?php $error = ''; // error message $name = ''; // sender's name $email = ''; // sender's email address $subject = ''; // subject $message = ''; // the message itself $spamcheck = ''; // Spam check if(isset($_POST['send'])) { $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; $spamcheck = $_POST['spamcheck']; if(trim($name) == '') { $error = '<div class="errormsg">Please enter your name!</div>'; } else if(trim($email) == '') { $error = '<div class="errormsg">Please enter your email address!</div>'; } else if(!isEmail($email)) { $error = '<div class="errormsg">You have enter an invalid e-mail address. Please, try again!</div>'; } if(trim($subject) == '') { $error = '<div class="errormsg">Please enter a subject!</div>'; } else if(trim($message) == '') { $error = '<div class="errormsg">Please enter your message!</div>'; } else if(trim($spamcheck) == '') { $error = '<div class="errormsg">Please enter the number for Spam Check!</div>'; } else if(trim($spamcheck) != '5') { $error = '<div class="errormsg">Spam Check: The number you entered is not correct! 2 + 3 = ???</div>'; } if($error == '') { if(get_magic_quotes_gpc()) { $message = stripslashes($message); } // the email will be sent here // Mailul tau $to = "andrey_90vs@yahoo.com"; // the email subject // '[Contact Form] :' will appear automatically in the subject. // You can change it as you want $subject = '[Contact Form] : ' . $subject; // the mail message ( add any additional information if you want ) $msg = "From : $name \r\ne-Mail : $email \r\nSubject : $subject \r\n\n" . "Message : \r\n$message"; mail($to, $subject, $msg, "From: $email\r\nReply-To: $email\r\nReturn-Path: $email\r\n"); ?> <!-- Message sent! (change the text below as you wish)--> <div style="text-align:center;"> <h1>Felicitari!!</h1> <p>Multumim <b><?=$name;?></b>, mesajul tau a fost trimis .</p> </div> <!--End Message Sent--> <?php } } if(!isset($_POST['send']) || $error != '') { ?> <!--Error Message--> <?=$error;?> <form method="post" name="contFrm" id="contFrm" action=""> <center> <table width="429" height="192" border="0"> <tr> <td width="91"><label><span class="required">*</span> Full Name:</label></td> <td width="328"><input name="name" type="text" class="box" id="name" size="30" value="<?=$name;?>" /></td> </tr> <tr> <td><span class="required">*</span> Email:</td> <td><input name="email" type="text" class="box" id="email" size="30" value="<?=$email;?>" /></td> </tr> <tr> <td><span class="required">*</span> Subject:</td> <td><input name="subject" type="text" class="box" id="subject" size="30" value="<?=$subject;?>" /></td> </tr> <tr> <td><span class="required">*</span> Message:</td> <td><textarea name="message" cols="40" rows="3" id="message"><?=$message;?> </textarea></td> </tr> <tr> <td><span class="required">*</span> Spam Check:</td> <td><label><b>2 + 3=</b></label> <input name="spamcheck" type="text" class="box" id="spamcheck" size="4" value="<?=$spamcheck;?>" /> <input name="send" type="submit" id="send" value="Trimite mail" /></td> </tr> </table></center> </form> <hr /> <!-- E-mail verification. Do not edit --> <?php } function isEmail($email) { return(preg_match("/^[-_.[:alnum:]]+@((([[:alnum:]]|[[:alnum:]][[:alnum:]-]*[[:alnum:]])\.)+(ad|ae|aero|af|ag|ai|al|am|an|ao|aq|ar|arpa|as|at|au|aw|az|ba|bb|bd|be|bf|bg|bh|bi|biz|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|com|coop|cr|cs|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|in|info|int|io|iq|ir|is|it|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|mg|mh|mil|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|museum|mv|mw|mx|my|mz|na|name|nc|ne|net|nf|ng|ni|nl|no|np|nr|nt|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|pro|ps|pt|pw|py|qa|re|ro|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw)$|(([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5])\.){3}([0-9][0-9]?|[0-1][0-9][0-9]|[2][0-4][0-9]|[2][5][0-5]))$/i" ,$email)); } ?> Am urmatorul formular cum pot face cand cineva vrea sa trimita mail sa ii apara si o lista cu mai multe adrese de contact si el sa selecteze pe care vrea? De exemplu eu am : $to = "andrey_90vs@yahoo.com";, cum pot face si un $to2 = ält mail", iar cel care trimite s apoata selecta ori s$to ori $to2 ? Astept raspuns , ms.
-
am reusit sa il repar ... era vorba de niste variabile rau definite.. ms de raspuns.
-
AM un script de editare pt. o tabela din baza de date ... totul merge corect , adica cand dau pe butonul de editare imi apare formul , ii schimb continutul si dau pe buton salveaza , primesc ca mesaj: Bannerul a fost editat, dar in baza de date nu se editeaza nimic .. <?php if($_POST['action']=="salveaza"){ //var_dump($_POST); if (isset($_POST['banner']) && isset($_POST['banner_link']) && isset($_POST['target'])) { // Se filtreaza datele pt. eliminare posibile spatii exterioare si tag-uri $_POST = array_map("trim", $_POST); $_POST = array_map("strip_tags", $_POST); // Se verifica daca "magic_quotes_gpc()" este setat ON // Daca e ON, se aplica stripslashes() pentru a nu se adauga de 2 ori '\' cand va fi aplicat "mysql_real_escape_string()" if(get_magic_quotes_gpc()) { $_POST = array_map("stripslashes", $_POST); } // Se verifica daca au fost completate corect toate campurile // Daca au fost completate le preia in variabile, in caz contrar seteaza o variabila tip Array cu mesaj de eroare // Verifica daca Pachetul are cel putin 1 caractere si maxim 150 if(strlen($_POST['banner'])>1 && strlen($_POST['banner'])<150) $pachet = $_POST['banner']; else $eroare[] = 'Error Banner : Bannerul trebuie sa contina intre 1 si 150 de caractere!'; // Verifica daca tip are cel putin 1 si cel mult 1000 if(strlen($_POST['banner_link'])>0 && strlen($_POST['banner_link'])<1000) $tip = $_POST['banner_link']; else $eroare[] = 'Error Banner link : Linkul trebuie sa contina intre 0 si 1000 de caractere!'; // Verifica daca tip are cel putin 1 si cel mult 1000 if(strlen($_POST['target'])>0 && strlen($_POST['target'])<1000) $tip = $_POST['target']; else $eroare[] = 'Error target : Targetul trebuie sa contina intre 0 si 1000 de caractere!'; $banner = mysql_real_escape_string($banner); $banner_link = mysql_real_escape_string($banner_link); $target = mysql_real_escape_string($target); $sql = "UPDATE `host_banner` SET `banner`='{$banner}', `banner_link`='{$banner_link}', `target`='{$target}' WHERE id_banner='{$_POST['id']}'"; if (mysql_query($sql)) { $mesaj = "<center><br><br><br><br>Bannerul a fost editat!<br><br></center>"; } else $mesaj = '<font color="red">Bannerul nu a putut fi editat: '. mysql_error(). '</font>'; } echo $mesaj; } if($_GET['action']=="editeaza"){ $row = mysql_fetch_array(mysql_query("SELECT * FROM `host_banner` WHERE id_banner='{$_GET['id']}'")); $id = $row[0]; $banner = $row[1]; $banner_link = $row[2]; $target = $row[3]; ?> <form method="post" action="bannere.php"> <table width="474" align="left" class="myform" id="stylized"> <tbody> <tr> <td colspan="2"><h1>Adaugare bannere</h1> Adaugare bannere in partea dreapta sus: <a href="../index.php">Vizualizare</a></td> </tr> <tr> <th><label>Banner: <span class="small">Link catre imagine</span> </label></th> <td width="256"><input name="banner" type="text" id="banner" size="60" value="<?php echo $banner; ?>" /></td> </tr> <tr valign="left"> <th><label>Link: <span class="small">Link-ul asociat bannerului</span> </label></th> <td><input name="banner_link" type="banner_link" id="banner_link" size="60" value="<?php echo $banner_link; ?>" /></td> </tr> <tr> <td colspan="2"><button name="action" value="salveaza" />Salvare</button></td> </tr> </tbody> </table> </form> <?php } mysql_close($conexiune); ?> Astept reply care stie ... ms. app asta ii linkul care il folosesc la edit: <a href="?action=editeaza&id=<? print $id_banner; ?>"><img src="css/edit.gif" border="0" width="29" height="18" /></a>
-
sa nu razi te rog ... Nu am deschis xampp-ul ... Acelasi script il utilizasem cu o zi in urma si mergea si cu xampp=ul inchis iar dupa ce am mai adaugat niste campuri si variabile nu mai mergea .. mam gandit ca trebuie sa fie o problema de php dar na .. pana nu te lovesti nu te doare Ms pt ajutor oricum! scriptul e foarte bun folositi-l cu incredere daca aveti nevoie va pot da si mysqlul.
-
am reusit pana la urma ... multzam' pt ajutor.
-
Cred ca mare dreptate ca eu am mai folosit scriptul acesta la alt form si mergea perfect ... Formul actual care il folosesc ii acesta : <form id="form_167766" class="appnitro" method="post" action="adauga.php"> <tr> <td><table align="center" width="435" border="0"> <tr> <td width="202"><label class="description" for="pachet">Nume Pachet:</label></td> <td width="178"><label class="description">Caracteristici:</label></td> <td width="178"><label class="description">Valori:</label></td> </tr> <tr> <td><div> <input id="element_1" name="pachet" class="element text medium" type="text" maxlength="255" value=""/> </div></td> <td><label class="description">Orice port dorit:</label></td> <td><input name="port" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="port" value="Nu"/> NU </td> </tr> <tr> <td><label class="description" for="tip">Tip: war/public</label></td> <td><label class="description">IP dedicat:</label></td> <td><input name="dedicat" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="dedicat" value="Nu"/> NU</td> </tr> <tr> <td><div> <input id="element_1" name="tip" class="element text medium" type="text" maxlength="255" value=""/> </div></td> <td><label class="description">Baza de date:</label></td> <td><select name="bazadedate" id="bazadedate"> <option>MySQL</option> </select></td> </tr> <tr> <td><label class="description" for="slot">Numar Sloturi:</label></td> <td><label class="description">Acces FTP:</label></td> <td><input name="ftp" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="ftp" value="Nu"/> NU</td> </tr> <tr> <td><div> <input id="element_1" name="slot" class="element text medium" type="text" maxlength="255" value=""/> </div></td> <td><label class="description">Antiflood:</label></td> <td><input name="antiflood" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="antiflood" value="Nu"/> NU</td> </tr> <tr> <td><label class="description" for="pret">Pret server:</label></td> <td><label class="description">Antiddos:</label></td> <td><input name="antiddos" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="antiddos" value="Nu"/> NU</td> </tr> <tr> <td><div> <input id="element_1" name="pret" class="element text medium" type="text" maxlength="255" value=""/> </div></td> <td><label class="description">Control Panel:</label></td> <td><select name="cpanel" id="cpanel"> <option>GameCP</option> </select></td> </tr> <tr> <td><label class="description" for="fps">Numar FPS-uri:</label></td> <td><label class="description">Subdomeniu:</label></td> <td><div> <input id="element_1" name="subdomeniu" class="element text medium" type="text" maxlength="255" value=""/> </div></td> </tr> <tr> <td><div> <input id="element_1" name="fps" class="element text medium" type="text" maxlength="255" value=""/> </div></td> <td><label class="description">Restrictii/Contract:</label></td> <td><input name="restictii" type="radio" class="button_text" value="Da" checked="checked"/> DA <input type="radio" name="restrictii" value="Nu"/> NU</td> </tr> <td><input type="submit" value="TRIMITE" /></td> <td><input name="Reset" type="reset" value="RESET" /></td> </table> </form> M-am uitat de cateva ori pe el si nu observ greseli .... ar putea fi de la <label> ? Astept raspuns din partea celor care stiu unde ii pb , ms ff mult.
-
imi arata pagina alba daca pun acolo $mesaj = ... Altceva?
-
daca il mut ..imi arata pagina alba si tot nu ii ok.
-
Am facut zilele acestea un formular de adaugare niste date intr-o baza de date, iar in fisierul de actiune am urmatorul script: <head> <SCRIPT language="JavaScript"> <!-- function getgoing() { top.location="add.php"; } if (top.frames.length==0) { alert("In 5 secunde revii la pagina anterioara!"); setTimeout('getgoing()',5000); } //--> </SCRIPT> </head> <?php error_reporting(-1); if (isset($_POST['pachet']) && isset($_POST['tip']) && isset($_POST['slot']) && isset($_POST['pret']) && isset($_POST['fps']) && isset($_POST['port']) && isset($_POST['dedicat']) && isset($_POST['bazadedate']) && isset($_POST['ftp']) && isset($_POST['antiflood']) && isset($_POST['antiddos']) && isset($_POST['cpanel']) && isset($_POST['subdomeniu']) && isset($_POST['restrictii'])) { // Se filtreaza datele pt. eliminare posibile spatii exterioare si tag-uri $_POST = array_map("trim", $_POST); $_POST = array_map("strip_tags", $_POST); // Se verifica daca "magic_quotes_gpc()" este setat ON // Daca e ON, se aplica stripslashes() pentru a nu se adauga de 2 ori '\' cand va fi aplicat "mysql_real_escape_string()" if(get_magic_quotes_gpc()) { $_POST = array_map("stripslashes", $_POST); } // Se verifica daca au fost completate corect toate campurile // Daca au fost completate le preia in variabile, in caz contrar seteaza o variabila tip Array cu mesaj de eroare // Verifica daca Pachetul are cel putin 1 caractere si maxim 150 if(strlen($_POST['pachet'])>1 && strlen($_POST['pachet'])<150) $pachet = $_POST['pachet']; else $eroare[] = 'Error Paket : Pachetul trebuie sa contina intre 1 si 150 de caractere!'; // Verifica daca tip are cel putin 1 si cel mult 1000 if(strlen($_POST['tip'])>1 && strlen($_POST['tip'])<1000) $tip = $_POST['tip']; else $eroare[] = 'Error Tip : Tipul trebuie sa contina intre 1 si 1000 de caractere!'; // Slot intre 1 si 100 de caractere if(strlen($_POST['slot'])>1 && strlen($_POST['slot'])<100) $slot = $_POST['slot']; else $eroare[] = 'Error Slot : Sloturile trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca Pretul are cel putin 1 caractere si maxim 100 if(strlen($_POST['pret'])>1 && strlen($_POST['pret'])<100) $pret = $_POST['pret']; else $eroare[] = 'Error Pret : Preturile trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca FPS are cel putin 1 caractere si maxim 1000 if(strlen($_POST['fps'])>1 && strlen($_POST['fps'])<1000) $fps = $_POST['fps']; else $eroare[] = 'Error FPS : Fps-ul trebuie sa contina intre 1 si 1000 caractere!'; // Verifica daca Portul are cel putin 1 caractere si maxim 150 if(strlen($_POST['port'])>1 && strlen($_POST['port'])<150) $port = $_POST['port']; else $eroare[] = 'Error Port : Portul trebuie sa contina intre 1 si 150 de caractere!'; // Verifica daca dedicatul are cel putin 1 si cel mult 1000 if(strlen($_POST['dedicat'])>1 && strlen($_POST['dedicat'])<1000) $dedicat = $_POST['dedicat']; else $eroare[] = 'Error Dedicat : Dedicat trebuie sa contina intre 1 si 1000 de caractere!'; // Baza de date intre 1 si 100 de caractere if(strlen($_POST['bazadedate'])>1 && strlen($_POST['bazadedate'])<100) $bazadedate = $_POST['bazadedate']; else $eroare[] = 'Error Baza de date : Baza de date trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca FTP are cel putin 1 caractere si maxim 100 if(strlen($_POST['ftp'])>1 && strlen($_POST['ftp'])<100) $ftp = $_POST['ftp']; else $eroare[] = 'Error FTP : FTP-UL trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca Antiflood are cel putin 5 caractere si maxim 6 if(strlen($_POST['antiflood'])>1 && strlen($_POST['antiflood'])<1000) $antiflood = $_POST['antiflood']; else $eroare[] = 'Error antiflood : antiflood-ul trebuie sa contina intre 1 si 1000 caractere!'; // Verifica daca antiddosul are cel putin 1 si cel mult 1000 if(strlen($_POST['antiddos'])>1 && strlen($_POST['antiddos'])<1000) $antiddos = $_POST['antiddos']; else $eroare[] = 'Error Anti-ddos : Anti-ddosul trebuie sa contina intre 1 si 1000 de caractere!'; //Controlpanelul trebuie sa contina intre 1 si 100 de caractere if(strlen($_POST['cpanel'])>1 && strlen($_POST['cpanel'])<100) $cpanel = $_POST['cpanel']; else $eroare[] = 'Error Cpanel: Cpanelul trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca Subdomeniu are cel putin 1 caractere si maxim 100 if(strlen($_POST['subdomeniu'])>1 && strlen($_POST['subdomeniu'])<100) $subdomeniu = $_POST['subdomeniu']; else $eroare[] = 'Error Subdomeniu : Sub-domeniul trebuie sa contina intre 1 si 100 caractere!'; // Verifica daca Restrictii are cel putin 1 caractere si maxim 1000 if(strlen($_POST['restrictii'])>1 && strlen($_POST['restrictii'])<1000) $restrictii = $_POST['restrictii']; else $eroare[] = 'Error Restrictii : restrictiile trebuie sa contina intre 1 si 1000 caractere!'; if (!isset($eroare)) { $username="user"; $password="user"; $database="test"; $localhost = "localhost"; $con = mysql_connect("$localhost","$username","$password"); if (!$con) { die('Nu sa putut conecta la baza de date: ' . mysql_error()); } mysql_select_db($database, $con); // Se aplica functia de filtrare mysql_real_escape_string() $pachet = mysql_real_escape_string($pachet); $tip = mysql_real_escape_string($tip); $slot = mysql_real_escape_string($slot); $pret = mysql_real_escape_string($pret); $fps = mysql_real_escape_string($fps); $port = mysql_real_escape_string($port); $dedicat = mysql_real_escape_string($dedicat); $bazadedate = mysql_real_escape_string($bazadedate); $ftp = mysql_real_escape_string($ftp); $antiflood = mysql_real_escape_string($antiflood); $antiddos = mysql_real_escape_string($antiddos); $cpanel = mysql_real_escape_string($cpanel); $subdomeniu = mysql_real_escape_string($subdomeniu); $restrictii = mysql_real_escape_string($restrictii); // Acum se adauga mai in siguranta aceste date in MySQL $sql = "INSERT INTO `host_servere` (`pachet`, `tip`, `slot`, `pret`, `fps`, `port`, `dedicat`, `bazadedate`, `ftp`, `antiflood`, `antiddos`, `cpanel`, `subdomeniu`, `restrictii`) VALUES ('$pachet', '$tip', '$slot', '$pret', '$fps', '$port', '$dedicat', '$bazadedate', '$ftp', '$antiflood', '$antiddos', '$cpanel', '$subdomeniu', '$restrictii')"; if (mysql_query($sql)) { $mesaj = "<center><br><br><br><br>Operatiune terminata cu succes!</center>"; } else $mesaj = '<font color="red">Continutul nu a putut fi adaugat '. mysql_error(). '</font>'; mysql_close($con); } else $mesaj = '<font color="red">'. implode('<br />', $eroare). '</font>'; } echo $mesaj; ?> Imi da eroarea aceasta: Notice: Undefined variable: mesaj in C:\xampp\htdocs\host\adauga.php on line 132, am verificat de mai multe ori dar nu gasesc problema , la linia 132 ii echo $mesaj. Astept raspuns plz.
-
Ca sa nu mai fac un nou topic voi intreba tot aici ! img=http://img140.imageshack.us/img140/5290/photo1twc.jpg Cum as putea sa separ partea <form> de partea cu imagini dar totusi sa le am in acelasi fisier? Adica partea de jos de la imagine + codurile bb/html sa apara dupa ce dau Check server , ms
-
linia 87 : if (mysql_query($sql, $conn)) { linia 93 : mysql_close($conn); ms pentru raspunsul rapid. merge super acum ...
-
<form method="post" action="adauga.php"> <table cellpadding="4" cellspacing="0"> <tr> <td>Server-Name:</td> <td><input type="text" name="name" size="30" /></td> </tr> <tr> <td>Game:</td> <td><input type="text" name="game" size="2" maxlength="2" value="cs"></td> </tr> <tr> <td>Server IP:</td> <td><input type="text" name="ip" size="30" /></td> </tr> <tr> <td>Server Port:</td> <td><input type="text" name="port" size="30" /></td> </tr> <tr> <td>Server Query:</td> <td><input type="text" name="query" size="30" /></td> </tr> <tr> <td> </td> <td><input type="submit" value="ADAUGA" /></td> </tr> </table> </form> <?php if (isset($_POST['name']) && isset($_POST['game']) && isset($_POST['ip']) && isset($_POST['port']) && isset($_POST['query'])) { // Se filtreaza datele pt. eliminare posibile spatii exterioare si tag-uri $_POST = array_map("trim", $_POST); $_POST = array_map("strip_tags", $_POST); // Se verifica daca "magic_quotes_gpc()" este setat ON // Daca e ON, se aplica stripslashes() pentru a nu se adauga de 2 ori '\' cand va fi aplicat "mysql_real_escape_string()" if(get_magic_quotes_gpc()) { $_POST = array_map("stripslashes", $_POST); } // Se verifica daca au fost completate corect toate campurile // Daca au fost completate le preia in variabile, in caz contrar seteaza o variabila tip Array cu mesaj de eroare // Verifica daca Numele are cel putin 5 caractere si maxim 50 if(strlen($_POST['name'])>5 && strlen($_POST['name'])<50) $name = $_POST['name']; else $eroare[] = 'Error Name : 5 and 50 characters'; // Verifica daca GAME are cel putin 2 si cel mult 3 if(strlen($_POST['game'])>1 && strlen($_POST['game'])<3) $game = $_POST['game']; else $eroare[] = 'Error Game : 2 and 3 characters'; // Ip intre 5 si 25 de caractere if(strlen($_POST['ip'])>5 && strlen($_POST['ip'])<25) $ip = $_POST['ip']; else $eroare[] = 'Error IP : 5 and 25 characters'; // Verifica daca Portul are cel putin 5 caractere si maxim 6 if(strlen($_POST['port'])>4 && strlen($_POST['port'])<6) $port = $_POST['port']; else $eroare[] = 'Error Port : 5 and 6 characters'; // Verifica daca Query are cel putin 5 caractere si maxim 6 if(strlen($_POST['query'])>4 && strlen($_POST['query'])<6) $query = $_POST['query']; else $eroare[] = 'Error Query : 5 and 6 characters'; if (!isset($eroare)) { $username="user"; $password="user"; $database="test"; $localhost = "localhost"; $con = mysql_connect("$localhost","$username","$password"); if (!$con) { die('Nu sa putut conecta la baza de date: ' . mysql_error()); } mysql_select_db($database, $con); // Se aplica functia de filtrare mysql_real_escape_string() $name = mysql_real_escape_string($name); $game = mysql_real_escape_string($game); $ip = mysql_real_escape_string($ip); $port = mysql_real_escape_string($port); $query = mysql_real_escape_string($query); // Acum se adauga mai in siguranta aceste date in MySQL $sql = "INSERT INTO `ws_a96_phgstats` (`name`, `game`, `ip`, `port`, `query`) VALUES ('$name', '$game', '$ip', '$port', '$query')"; if (mysql_query($sql, $conn)) { $mesaj = '<font color="blue">Serverul a fost adaugat</font>'; $name = ''; $ip = ''; } else $mesaj = '<font color="red">Serverul nu a putut fi adaugat '. mysql_error(). '</font>'; mysql_close($conn); } else $mesaj = '<font color="red">'. implode('<br />', $eroare). '</font>'; } echo $mesaj; ?> am urmatorul cod care imi insereaza intr-un tabel campurile de mai sus ... da primesc o eroare cand il, rulez : Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\adauga.php on line 87 Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in C:\xampp\htdocs\adauga.php on line 93 Serverul nu a putut fi adaugat Stiti careva unde am gresit???
-
Uhh ce bn ...dau anul asta eu .. is mari idioti cu sistemul lor de invatamant , ce face scoala , liceul si facultatea? te invata sa fii sclavul societatii si sa muncesti o viata intreaga ca robul... intrebarea e pt ce? Ca sa platesti taxe si impozite de kkt la stat ... dreq sa ii ia ...
-
ai pm ..astept sa ma contactezi
-
astept si eu un mic tutorial cum se foloseste acest program .. teoretic am prins ideea dar practic nu stiu cum ...
-
Salutare , caut o persoana care are timp la dispozitie pentru a lucra la un site (webdesign,configurarea unui script pt. portal,etc) pentru mai multe detalii astept pm ... in caz ca acea persoana doreste sa se implice mai mult il voi plati pt. serviciile care le face .
-
Nu imi place tinta la awp e facuta in PAINT