Jump to content

madness69

Members
  • Posts

    38
  • Joined

  • Last visited

Everything posted by madness69

  1. Hello there, i have a image upload that its not perfect bu it already enought for what i need, but there is a problem, the name of the image that i uploaded is always the same, and for some reason i upload a image whit same name it will overwright the image, i need to put my image upload code to give each image a unique name, here is the code to take a look. What is missing to accomplishe this? Best reagards $name=$_FILES['image']['name']; $tmp=$_FILES['image']['tmp_name']; $err=$_FILES['image']['error']; if($err==0) { move_uploaded_file($tmp, "../upload/$name"); } $name=$_FILES['image2']['name']; $tmp=$_FILES['image2']['tmp_name']; $err=$_FILES['image2']['error']; if($err==0) { move_uploaded_file($tmp, "../upload/$name"); } $img=$_FILES["image"]["name"]; $img2=$_FILES["image2"]["name"];
  2. Hello everybody, hope having some help, i have 2 tables called "camp" and "users" : camp - id - id_owner - camp_title - camp_info users - id - username - password - email Each camp is related to a user, thats why in table camp there is the "id_owner". Could someone tell me the Sql Query to get the email by the camp table since im working in the Edit camp page and i need to get the email that is related whit the camp owner. Best regards
  3. CREATE TABLE IF NOT EXISTS `categorys` ( `category` varchar(200) NOT NULL, PRIMARY KEY (`category`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `categorys` -- INSERT INTO `categorys` (`category`) VALUES ('profiles'), ('components'); --------------------------------------------------------- CREATE TABLE IF NOT EXISTS `articles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(200) NOT NULL, `category` varchar(200) NOT NULL, PRIMARY KEY (`id`,`title`,`category`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=93 ; -- -- Dumping data for table `articles` -- INSERT INTO `articles` (`id`, `title`,`category`) VALUES (60, '63101WMH20x20','profiles'),
  4. It doesnt work, gives me this error: Query Failed: Unknown column 'profile' in 'on clause'SELECT * FROM articles a JOIN categorys c ON profile = c.id ORDER BY a.id DESC LIMIT 0, 20
  5. hello there, i need some help to display some items from my articles table, the articles table is related whit the other table of mine called category, and in the table categorys there are on column that is called category, inside there are 3 type, and one of them that cals "profile" is the one i need, i need the display all of my articles that is related whit the table categorys and column named "profile", above is the original query Original query: $sql = "SELECT * FROM articles order by articles.id DESC LIMIT ".$from.", 20"; Query i tryed to change: $sql = "SELECT * FROM articles WHERE category = profile and order by articles.id DESC LIMIT ".$from.", 20"; I cant put this work i tryed many thign but no suscess, could someone help me? Could someone help me
  6. Hi there, does anybody have a idei whats up whit my slider, it comes out in the left side :\ http://webmine.netne.net/
  7. hi there guys, i have right a email form, and it works very well, but im having some trouble whit something, how can i make it possible to have a attachement file whit him, take a look of my code please: <?php $nome=$_POST["nome"]; $morada=$_POST["morada"]; $CodPostal1=$_POST["CodPostal1"]; $CodPostal2=$_POST["CodPostal2"]; $localidade=$_POST["localidade"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; ?> <form action="?p=recrutamento" method="post" name="form_contactos" id="contactos"> <?php if($dados) {echo "Por favor preencha os campos em falta.";} ?> <p style="width:220px;">Nome <input name="nome" type="text" id="nome" style="width:220px; float:left;" tabindex="1" size="220"> <?php if($dados && $nome=="");?></p> <p style="width:450px;">Morada <input name="morada" type="text" id="morada" style="width:450px; float:left;" tabindex="3" size="410"> <?php if($dados && $morada=="");?></p> <p style="width:230px;">Código Postal<br /> <input name="CodPostal1" type="text" id="CodPostal1" maxlength="4" style="width:25px;float:left" tabindex="4"> <?php if($dados && $CodPostal1=="");?> <input name="CodPostal2" type="text" id="CodPostal2" maxlength="3" style="width:18px;margin-left:5px;float:left;" tabindex="5"> <?php if($dados && $CodPostal2=="");?> <input name="localidade" type="text" id="localidade" style="width:155px;float:left; margin-left:5px;" tabindex="6"> <?php if($dados && $localidade=="");?> </p> <p>Tel./Tlm. <input name="telefone" type="text" id="telefone" style="width:210px;float:left;" tabindex="7"> <?php if($dados && $telefone=="");?> </p> <p style="width:220px;float:left;">E-mail<input name="email" type="text" id="email" style="width:220px; float:left;" tabindex="8"> <?php if($dados && $email=="");?> </p> <p style="width:450px;margin-left:20px;float:left;">file atachement </p> <p style="width:450px;">Mensagem: <textarea name="comentarios" rows="3" id="comentarios" style="width:450px;float:left;" tabindex="9"></textarea> <?php if($dados && $comentarios=="");?> </p> <p style="width:450px;">Protecão</p> <p style="width:100px;"> <img src="captcha/code.php" name="img_codigo" width="100" height="17" border="0" id="img_codigo" style="border:1px solid #abadb3; float:left;" ></p> <a href="javascript&#058;void(0);" onclick="actualiza_captcha();"><img src="images/refresh.png" alt="actualizar" title="actualizar" width="16" height="16" border="0" style="float:left;margin-left:15px;margin-top:5px;" ></a> <p style="width:90px;"><input name="codigo" type="text" class="texto2" id="codigo" style="width:80px; float:left;" tabindex="10" maxlength="5"> </p> <p style="width:70px;float:left;"> <img src="images/limpar.jpg" alt="LIMPAR" border="0" style="cursor:pointer; width:70px; height:19px ;float:left;margin-left:0px;" title="LIMPAR" onClick="javascript&#058;form_contactos.reset();"> <p style="width:90px;"><input name="enviar" type="image" onClick="return Form_Validator(form_contactos);" src="images/enviar.jpg" alt="ENVIAR" title="ENVIAR" style="height:19px; width:70px; border:none; float:left;"></p> </form> Than is redirect to this page to validate some info: <?php $nome=$_POST["nome"]; $morada=$_POST["morada"]; $CodPostal1=$_POST["CodPostal1"]; $CodPostal2=$_POST["CodPostal2"]; $localidade=$_POST["localidade"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; if (($nome != null) && ($morada != null) && ($CodPostal1 != null) && ($CodPostal2 != null) && ($localidade != null) && ($telefone != null) && ($email != null) && ($comentarios != null)) { include "final_recrutamento.php"; } else { $dados=true; include "contactos_recrutamento.php"; } ?> And finally to this page to have his action: <?php $nome=$_POST["nome"]; $morada=$_POST["morada"]; $CodPostal1=$_POST["CodPostal1"]; $CodPostal2=$_POST["CodPostal2"]; $localidade=$_POST["localidade"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; ?> <p><img src="imagens/separador_esq.png" alt="separador" /></p> <div class="submenu_contactos"> <?php include ("submenu_contactos.php"); ?></div> <div class="contactos_empresa_orcamentos"> <h1>quer fazer parte da nossa equipa?</h1> <p style="width:400px;line-height:1.6;float:left;"><?php $headers = "From: $email" . "\r\n" . "Content-type: text/plain; charset=utf-8" . "\r\n" . "X-Mailer: PHP/" . phpversion(); $to = "myemail"; $subject = "Formulário de recrutamento - site"; $body = "nome: $nome, morada: $morada, código postal: $CodPostal1 - $CodPostal2 $localidade, telefone: $telefone, email: $email, mensagem: $comentarios"; if (mail( $to , $subject , $body, $headers )) { echo("$nome, your file had been saved.<br /> Will be contacting.<br /> Thanks."); } else { echo("$nome, a error.<br /> Try again.<br /> Thanks. "); } ?></p> </div>
  8. hi guys, can someone help me, i have a send email form, but haves a problem, when i fill the camps it says me the form it wasnt fill :\ Here is the first part of the script code (informacoes.php): <?php $nome=$_POST["nome"]; $entidade=$_POST["empresa"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; ?> <div class="txt_int_empresa"> <h1><?php echo TEXTINFORMACOESHO1 ?></h1> <p class="texto3"><?php echo TEXTINFORMACOES11 ?></p> <form action="?p=pedido_informacoes" method="post" name="form_contactos" id="contactos" /> <?php if($dados) {echo "Por favor preencha os campos em falta.";} ?> <p class="texto3" style="width:230px;"><?php echo TEXTINFORMACOESO1 ?><br /> <input name="nome" type="text" id="nome" style="width:220px;margin-top:5px;" tabindex="1" size="220" /> <?php if($dados && $nome=="");?></p> <p class="texto3" style="width:230px;"><?php echo TEXTINFORMACOESO2 ?><span class="texto3" style="width:230px;"> <input name="entidade" type="text" id="entidade" style="width:210px; float:left;margin-top:5px;" tabindex="2" size="210" /> </span> <?php if($dados && $empresa=="");?> </p> <p class="texto3" style="width:230px;margin-top:15px;"><?php echo TEXTINFORMACOESO5 ?><br /> <input name="telefone" type="text" id="telefone" style="width:210px;margin-top:5px; " tabindex="7" /> <?php if($dados && $telefone=="");?> </p> <p class="texto3" style="width:230px;margin-top:15px;"><?php echo TEXTINFORMACOESO6 ?><input name="email" type="text" id="email" style="width:220px; margin-top:5px; float:left;" tabindex="8" /> <?php if($dados && $email=="");?> </p> <p class="texto3" style="width:450px;"><?php echo TEXTINFORMACOES10 ?><br /> <textarea name="comentarios" rows="5" id="comentarios" style="width:450px;font-family:Arial, Helvetica, sans-serif;font-size:12px;margin-top:5px;" cols="1" tabindex="9"></textarea> <?php if($dados && $comentarios=="");?> </p> <p class="texto3" style="width:100px; margin-top:14px;"> <img src="captcha/code.php" name="img_codigo" width="100" height="17" border="0" id="img_codigo" style="border:1px solid #abadb3; float:left;" ></p> <a href="javascript:void(0);" onclick="actualiza_captcha();"><img src="images/refresh.png" alt="actualizar" title="actualizar" width="16" height="16" border="0" alt="código"style="float:left;margin-left:13px;margin-top:18px;" ></a> <p style="width:90px; margin-top:16px; padding-left:11px;"><input name="codigo" type="text" class="texto2" id="codigo" style="width:80px; float:left;" tabindex="10" maxlength="5" /> </p> <p style="width:70px;float:left; margin-top:14px;padding-left:11px;"> <img src="images/limpar.jpg" alt="LIMPAR" border="0" style="cursor:pointer; width:70px; height:19px ;float:left;" title="LIMPAR" onClick="javascript:form_contactos.reset();"> <p class="texto3" style="width:90px; margin-top:16px; padding-left:69px;"><input name="enviar" type="image" onClick="return Form_Validator(form_contactos);" src="images/enviar.jpg" alt="ENVIAR" title="ENVIAR" style="height:19px; width:70px; border:none;" /></p> </form> </div> Second script thats checks (pedido_informacoes.php): <?php $nome=$_POST["nome"]; $entidade=$_POST["empresa"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; if (($nome != null) && ($entidade != null) && ($telefone != null) && ($email != null) && ($comentarios != null)) { include "final_informacoes.php"; } else { $dados=true; include "informacoes.php"; } ?> And last part that makes the action (final_informacoes.php): <?php $nome=$_POST["nome"]; $entidade=$_POST["empresa"]; $telefone=$_POST["telefone"]; $email=$_POST["email"]; $comentarios=$_POST["comentarios"]; ?> <div class="txt_int_empresa"> <h1><?php echo TEXTINFORMACOESHO1 ?></h1> <p class="texto3"><?php $headers = "From: $email" . "\r\n" . "Content-type: text/plain; charset=utf-8" . "\r\n" . "X-Mailer: PHP/" . phpversion(); $to = "meumail@hotmail.com"; $subject = "Pedido de orçamento - meusite"; $body = "nome: $nome, empresa: $empresa, telefone: $telefone, email: $email, mensagem: $comentarios"; if (mail( $to , $subject , $body, $headers )) { echo("$nome, o seu pedido foi enviado com sucesso.<br /> Em breve entraremos em contacto consigo.<br /> Obrigado."); } else { echo("$nome, ocorreu um erro no envio do seu pedido.<br /> Por favor volte a tentar.<br /> Obrigado."); } ?></p> </div> When i fill it, it only says : "Por favor preencha os campos em falta." Hope for some help
  9. Thanks a Lot Simon, this worked, finally a forum that give me the answeer lool
  10. Hi guys, im having a problem, in my phpfile were is generated the action code form the contacts form is giving me a lot of trouble, im receiving a lot of blank emails, first i thiked was bots,im usign a captcha, but then i notice another thing, when i put the name of the file that generates the action in the browser this loads it and send it the black email. How can i prevent for my php action file to dont be loadit in the browser? Here is the code to you guys have a idea <?php $datahora = "DATA: <B>" . date("d/m/y - H:i:s") . "</B><BR><BR>"; foreach ($_POST as $campo => $valor) { if (($campo == 'imageField2_x') or ($campo == 'imageField2') or ($campo == 'imageField2_y') or ($campo == 'distrito') or ($campo == 'subimit_y') or ($campo == 'codigo') or ($campo == 'seguranca')) {}else { if ($valor <> '') { $campo = str_replace("_", " ",$campo); $campos .= strtoupper($campo) . ": <b>" . $valor . "</b><Br>"; } } } $www = "WWW.USA.COM"; $assunto = "CONTACT - USA - " . $www; $conteudo = "CONTACT - USA<br><br>" . $datahora . ($campos) . "<br>" . $www; $para = "madness@hotmail.com"; $headers = "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n"; $headers .= "From: USA <info@usa.com>\r\n"; $headers .= "Reply-To: ".$_POST['email']."\r\n"; if ($_POST['codigo'] == $_POST['seguranca']) { if (mail($para,$assunto,$conteudo,$headers) == true){ ?> <script> alert('Sent sucess!'); window.location = 'contact.php'; </script> <? }} ?> Hope for some help
  11. Yes, im experimenting, no better way than try, i will try your advice, is the first time i try something like that and proud in doing it, it looks a good challenge, im reading about triggers, it looks interesting. Thanks for the reply
  12. Hi guys, nice being a part of the forum, my question is, i have a network of differente websites, each of these websites work in the same services. All there backend, databases are the same, having there same tables, etc. Only thing that changes in them is the CSS for differente design of course. What i need it to do is when one of the websites insert a new product the other sites receives the same product of this website. All these site have the same capability, when site A insert a new product site B and C receives the same product in there databases, when site C insert new product site A and B receives the same product and forward. How can i achieve this accomplishment, maybe i should put this question in the mysql section but maybe here can help me. Be well
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.