Jump to content

PF2G

Members
  • Posts

    39
  • Joined

  • Last visited

    Never

About PF2G

  • Birthday 06/10/1992

Profile Information

  • Gender
    Male
  • Location
    Porto

PF2G's Achievements

Member

Member (2/5)

0

Reputation

  1. that's what i did in the first place but it's all seperated, then i used: border-collapse:collapse; and nothing happened.
  2. Hi, i'm trying to do a table with border:1px solid #000000 But i want border between rows and columns. Can someone help me, please? Here's my table if it helps or something: <table> <thead rowspan=1> <tr> <td>Nome da Banda</td> <td>Estilo</td> <td>Atividade</td> <td>Line Up Atual</td> <td>Line Up Tour</td> <td>Ex-Membros</td> <td>Linguagem</td> </tr> </thead> <tbody> </tbody> </table>
  3. the date in the DB is varchar, when i add i transform it in the format date (%d/%m/%Y).
  4. Youre right i forgot, but now the content doesn't appear :S $link = mysql_query("SELECT id, str_to_date(data,'%d/%m%/%Y') AS date FROM noticias WHERE date <= CURDATE() ORDER BY date"); $row = mysql_fetch_array($link); if ($row = mysql_fetch_array($link)) {
  5. Hi, I'm creating a SELECT statement where i select the date and if it's from today or past day it appears if it isn't it doesn't appear. I have this code but it does nothing: $data_hj_antes=mysql_query("SELECT data FROM noticias WHERE data <= CURRENT_DATE() ORDER BY data DESC") or die(mysql_error()); $hj_antes=mysql_fetch_assoc($data_hj_antes); if ($hj_antes=mysql_fetch_assoc($data_hj_antes)) { echo "<h1 class='title' style='padding-top:10px;'>". $desc_atual['titulo']. "<div class='escrit' style='margin-top:-20px;'>"; if (mysql_num_rows($query_not_ant)>0) { echo "<a href='".$current_lang."/".$module."/".$id_ant."'>&lt ANTERIOR</a>"; } else { echo "&lt ANTERIOR"; } echo "&nbsp &nbsp"; if (mysql_num_rows($query_next)>0) { echo "<a href='".$current_lang."/".$module."/".$id_nxt."'>SEGUINTE &gt</a>"; } else { echo "SEGUINTE &gt"; } echo "</div> </h1>"; echo '<div class="details">'; echo '<div class="descricao" style=" margin-left:15px; padding-bottom:15px;">'. $desc_atual['descricao'] .'</div>'; echo '</div>'; } Can some help me, please? Thank you PF2G
  6. Can someone help me please. I need some way to avoid copyright problems. Thank you, FP2G
  7. Or if you haveany other idea that could avoid other websites warn me about their images, i apreciate. Thank you again, PF2G
  8. Holy... I didn't thought about that thing of copyright. What if i create a .php file where i write something that says "i do not own the images they are just for information" or something like that and then i send the url image of the image uploaded to a table 'copy_img'? Do you think this could avoid copyright problems? Thank you both for replying PF2G
  9. Good Morning I'm doing a music website and i would like to do a form where users can suggest bands, so i made a form where you say the name of the band, some discription and choose an image from user's computer or by url. My issue is choosing from the computer, i know that i have to upload the image to a server but: 1. is this server the host where i have my website? 2. if yes how do i do, when i have only the name of the image? I don't have any code, i'm just asking for some hints. Please can someone help me? Thank you, PF2G
  10. Hi, i trying to do a registration form (easiest thing ever) but i'm having trouble doing the validation :S <?php include 'db_connect.php'; ?> <html> <head> <title>Adminstração</title> </head> <body style="color=#FFFFFF" bgcolor="#666666"> <table width="100%" height="100%" border="0" align="center" cellpadding="0" cellspacing="1"> <tr> <form method="post" action=""> <td align="center" valign="middle"> <table width="300px" cellpadding="0" cellspacing="3" bgcolor="#FFFFFF" style=" border: 1px solid #000000;"> <tr> <td style=" border-style:none;"> <br> </td> </tr> <tr> <td align="right" style="font-size: 13;font-family: Arial, Helvetica, sans-serif;font-weight: bold;border-style:none;"> Utlizador: </td> <td style=" border-style:none;"> <input name="user" type="text"> </td> </tr> <tr> <td align="right" style="font-size: 13;font-family: Arial, Helvetica, sans-serif;font-weight: bold;border-style:none;"> Password: </td> <td style=" border-style:none;"> <input name="password" type="password"> </td> </tr> <tr> <td colspan="2" align="center" style=" border-style:none;"> <input type="submit" name="registar" value="Registar"> </td> </tr> <tr> <td style=" border-style:none;"> <br> </td> </tr> </table> <span class="style1" style="font-size: 13;font-family: Arial, Helvetica, sans-serif;font-weight: bold;color: red;"> </span> </td> </form> </tr> </table> </body> </html> <?PHP if(isset($_POST['registar'])) { $username = $_POST['user']; $password = $_POST['password']; if (empty($username) OR empty($password)) { echo "<script>alert('Todos os campos são obrigatórios.') location.href = 'add_user.php';</script>"; } if ($username!="" && $password!="") { $sel_user="SELECT * FROM utilizadores"; $user=mysql_query($sel_user, $connect); $row_user=mysql_fetch_assoc($user); if ($username=$row_user['username']) { "<script>alert('O nome do utilizador ja existe.')</script>"; } else { $sql="INSERT INTO utilizadores (username, password) VALUES ('".$username."','".sha1($password)."')"; $result = mysql_query($sql); if(!$result) { echo "<script>alert('Erro a adicionar utilizador.')</script>"; } else { echo "<script>alert('Utilizador adicionado com sucesso.'); location.href = 'admin.php';</script>"; } } mysql_close($connect); } } ?> Please help me...
  11. I'm sorry... I'm not getting the translations, somthing because of the headers in common.php Can you help me?
  12. Hi, I'm working on a website where i have to translate the pages and the way i have to do is a little confused. Here it goes: I have to create 2 files lang_pt.php and lang_en.php where i have common arrays where i do the translation. lang_pt.php: <?PHP $lang['Family Office']="Family Office"; $lang['Multi Family Office']="Multi Family Office"; $lang['Foco']="Foco"; $lang['Serviços']="Serviços"; $lang['Valores']="Valores"; $lang['Seminários']="Seminários"; $lang['Contactos']="Contactos"; $lang['Português']="Português"; $lang['Inglês']="Inglês"; ?> lang_en.php: <?PHP $lang['Family Office']="Family Office"; $lang['Multi Family Office']="Multi Family Office"; $lang['Foco']="Foco"; $lang['Serviços']="Services"; $lang['Valores']="Values"; $lang['Seminários']="Seminars"; $lang['Contactos']="Contacts"; $lang['Português']="Portuguese"; $lang['Inglês']="English"; ?> Then i have to include this 2 files in another, common.php. An it's here where i get confused....I have to include the files in this common.php and then i have to do a switch for the languages (i'm not sure if it's correct): <?PHP $lang=$_GET['lang']; include 'lang_pt.php'; include 'lang_en.php'; echo $lang['Family Office']; echo $lang['Family Office']; echo $lang['Multi Family Office']; echo $lang['Foco']; echo $lang['Serviços']; echo $lang['Valores']; echo $lang['Seminários']; echo $lang['Contactos']; echo $lang['Português']; echo $lang['Inglês']; switch ($lang) { case "lang_pt.php": header ('Location: index.php?lang=pt'); die(); break; case "lang_en.php": header ('Location: index.php?lang=en'); die(); break; default: header ('Location: index.php?lang=pt'); die(); break; } ?> Then include the common.php in all other files so it can do the translation. I think this is the most clear i can be. If someone can help me, i appreciate. I'll try to explain better if you want to. Thank You, PF2G
  13. hi i'm new at SQL so i'm working on a website where i add info and delete. The delete part i want a message box to confirm if i really want to delete the info: <!----------------------------------------------> <script type="text/JavaScript"> function confirmDelete() { var agree=confirm("Tem a certeza que quer remover?"); if (agree) { return true; } else { return false; } } </script> <!----------------------------------------------> In the add.php: <?PHP include 'db_connect.php'; $query_ident="SELECT * FROM content"; $ident=mysql_query($query_ident, $connect); $row_ident=mysql_fetch_assoc($ident); ?> <html> <head> <title>Administração - Adicionar</title> </head> <body style="color:#FFFFFF;" bgcolor="#666666"> <form action="" method="POST"> <table> <tr> <td align="right"> Identificador: </td> <td> <select name="identifier"> <?PHP do{ ?> <option value="<?PHP echo $row_ident['id_content']; ?>"> <!--selcciona opção definida--> <?PHP echo $row_ident['identifier']; ?> </option> <?PHP } while ($row_ident=mysql_fetch_assoc($ident)); ?> </select> </td> </tr> <tr height="10px"></tr> <tr> <td align="right"> Linguagem: </td> <td> <select name="lang"> <option value="1"> Português </option> <option value="2"> Inglês </option> </select> </td> </tr> <tr height="10px"></tr> <tr> <td align="right"> Título: </td> <td> <input type="text" name="titulo"> </input> </td> </tr> <tr height="10px"></tr> <tr> <td align="right" valign="top"> Conteúdo: </td> <td> <textarea name="descricao" cols="50" rows="10"></textarea> </td> </tr> <tr> <td></td> <td> <input type="submit" name="adicionar" value="Adicionar Informação" /> <a href="javascript:history.go(-1);"><input type="button" name="update" value="Voltar"/></a> </td> </tr> </table> </form> </body> </html> <?PHP /*************************************************/ if (isset($_POST['adicionar'])) { $identifier=$_POST['identifier']; $lang=$_POST['lang']; $titulo=$_POST['titulo']; $descricao=$_POST['descricao']; $sel_ident="SELECT * FROM content WHERE identifier='".$identifier."'"; $ident=mysql_query($sel_ident, $connect); $row_ident=mysql_fetch_assoc($ident); $sel_id="SELECT * FROM content_lang WHERE id_content='".$row_ident['id_content']."'"; $id=mysql_query($sel_id, $connect); $row_id=mysql_fetch_assoc($id); if($add_info=mysql_query("INSERT INTO content_lang (id_content, lang, titulo, descricao) VALUES ('".$row_id['id_content']."', '".$lang."', '".$titulo."', '".$descricao."')")) { echo 'Adicionado com sucesso.'; } else { echo 'Informação não foi inserida devido a um problema no sistema.'; } } ?> It gives me the second message, it means that the info wasn't inserted. Can someone help me?
  14. It doesn't do anything...i didn't write a thing in username and i submited and it erased everything.
  15. Sorry, it erases everything. $username=isset( $_POST['username'] ) ? htmlspecialchars($_POST['username']) : ''; if( $username != '' ) echo "You entered username[$username]<br>"; ?> <!-- content --> <div class="indent"> <h2> Inscrição </h2> <form action="" method="post"> <fieldset> <legend> ALUNO </legend> <br/> <div class="field"><label>Username*: </label><input type="text" name="username" value="<?php echo $username ?>" /></div>
×
×
  • 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.