Jump to content

madness69

Members
  • Posts

    38
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

madness69's Achievements

Member

Member (2/5)

0

Reputation

  1. So how should this be coded? Above i leave the strcuture of database: days_week: - id; - day; Records Inserted: Monday, Tuesday...Sunday; available: - id_available (primary, auto-incremento); - user_id; - day_time; - week_day; Inseted Records: 6, 1, 1:00, Monday; 7, 1, 1:00, Tuesday;
  2. Hi there, hope have some help. I have a form where a user select time and days of the week (monday, tuesday..) that he is available. The insert script works fine, it insert and the days of week he checked in the table, the only problme is when i try to update each of them. I used this code above, but is not working, instead of updating/inserting days that is selected is inserting multi-records with the same day of the week value. here it is: foreach($weekDay as $DaysofWeek){ $sql_days = "UPDATE available SET day_time = '$day_time', week_day = '$DaysofWeek' WHERE user_id = '$id_user'"; $update_availability = mysql_query($sql_days); }
  3. hello? I hope to get some help, I have a script of job applications, basically what it does is when a user is going to apply for a job, the user information (name, email, message, cv) are sent to the database and the CV is saved in a folder on the server.The company that created the job opening receives an email with the details of the candidate that was filled in the form. The script works fine, but I have only one problem, I need to get in the email the CV attached but i dont no how to do. Could someone see the code and tell me what is missing in add code and how to fill the rest? Here is the code above if(isset($_FILES['files'])){ $errors= array(); foreach($_FILES['files']['tmp_name'] as $key => $tmp_name ){ $file_name = $key.$_FILES['files']['name'][$key]; $file_size =$_FILES['files']['size'][$key]; $file_tmp =$_FILES['files']['tmp_name'][$key]; $file_type=$_FILES['files']['type'][$key]; $random_digit=rand(0000,9999); $new_file_name=$random_digit.$file_name; if($file_size > 2097152){ $errors[]='File size must be less than 2 MB'; } $query2="INSERT into candidates (`firstname`,`lastname`,`mobile`,`email`,`message`,`id_company`,`titulo_anuncio`,`job_type`,`data`,ativo) VALUES('$firstname','$lastname','$mobile','$email_candidate','$message','$id_company','$title_en','$job_type','$data','1'); "; mysql_query($query2); $user_id = mysql_insert_id(); $query="INSERT into imagens (`id_candidate`,`file`,`size`,`type`) VALUES('$user_id','$new_file_name','$file_size','$file_type'); "; $to = $email; $subject = " Job Portal - New Candidate"; $body = ""; $body .= "Title: "; $body .= $title_en; $body .= "\n"; $body .= "Tel: "; $body .= $mobile; $body .= "\n"; $body .= "Email: "; $body .= $email_candidate; $body .= "\n"; $body .= "Message: "; $body .= $message; $body .= "\n"; $body .= "CV: "; $body .= "In attachement"; $body .= "\n"; $headers = "From:" . $to; if (mail($to, $subject, $body,$headers)) $desired_dir="candidatos_cv"; if(empty($errors)==true){ if(is_dir($desired_dir)==false){ mkdir("$desired_dir", 0700); } if(is_dir("$desired_dir/".$new_file_name)==false){ move_uploaded_file($file_tmp,"$desired_dir/".$new_file_name); }else{ // rename the file if another one exist $new_dir="$desired_dir/".$new_file_name.time(); rename($file_tmp,$new_dir) ; } mysql_query($query); }else{ print_r($errors); } } if(empty($error)){ echo "<span style=\"color:green;font-weight:bold;\">Job applied whit Sucess</span>"; } }
  4. Hello, im using jquery datepicker, and i can make 2 inputs fields calling the datepicker, but when i clone or add 2 more fields i cant put the other input fields to work: Here is the link http://tiny.cc/6hadww
  5. sorry, afterall your first solution worked, is everything working well thanks a lot , one more question, in this link. http://tiny.cc/6hadww I use the same functionality of adding input fields, but the problem is the input fields that are cloned the datepicker doesnt work, could you take a look?
  6. Thanks fot the response, it doesnt do nothing, doesnt insert nothing.
  7. Hi there, im creating a form that i can add and clone the inputs in my form, is for a hostel site, the client needs to add many seasons date, name , type of season, this type of info, so the problem is in my code it creates but create 2 more records in database whit blank info, am i doing somethign wrong? Above is my code: The php action code: $title_season = $_POST['title_season']; $type_season = $_POST['type_season']; $date_begin = $_POST['date_begin']; $date_final = $_POST['date_final']; $price = $_POST['price']; $all_info = array($title_season,$type_season,$date_begin,$date_final,$price); for ($i=0; $i<sizeof($all_info);$i++){ $sql_insert=mysql_query("INSERT INTO seasoninfo(title_season,type_season,date_begin,date_final,price)VALUES('$title_season[$i]','$type_season[$i]','$date_begin[$i]','$date_final[$i]','$price[$i]')"); } Form: <form method="POST" id="SignupForm" action="preco_epoca.php"> <fieldset> <style type="text/css"> .remove {color:#cc0000} .input{ border: solid 1px #006699; padding:3px} </style> <script type="text/javascript" src="reCopy.js"></script> <script type="text/javascript"> $(function(){ var removeLink = ' <a class="remove" href="#" onclick="$(this).parent().slideUp(function(){ $(this).remove() }); return false">remover</a>'; $('a.add').relCopy({ append: removeLink}); }); </script> <table width="692" border="0"> <tr> <td width="309">Title</td> <td width="120">Seasion</td> <td width="65"> Date Begin</td> <td width="65"> Data Final</td> <td width="111"> Price;</td> </tr> <tr class="clone"> <td><input id="Email" name="title_season[]" type="text" /></td> <td><select name="type_season[]"> <option selected="selected">Seleccione</option> <option>Epoca Baixa</option> <option>Epoca Media</option> <option>Epoca Alta</option> </select></td> <td><input type="text" name="date_begin[]" style="width: 75px;margin-left:5px;" onfocus="this.value=''" value="Ano-Mês-Dia" /></td> <td><input type="text" name="date_final[]" style="width: 75px;margin-left:5px;" onfocus="this.value=''" value="Ano-Mês-Dia" /></td> <td><input type="text" name="price[]" style="width: 30px;margin-left:5px;" class="data" id="valor_epoca" /></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td><a href="#" class="add" rel=".clone"><img border="0" src="images/add.png" width="18" height="14" alt="add"> Add More Fields</a></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </fieldset> <fieldset> </fieldset> <fieldset> </fieldset> <p> </br> <input name="id_utilizador" type="hidden" value="<?php echo $id_hostel?>"> <input name="inserir" class="submter_estilo" type="submit" value="SUBMITE"> </p> <br> </form>
  8. Hello there, im having some problem whit my php code, i cant display the data from my database, is there somethign missing or wrong? Here is the code: $con = mysql_connect("localhost","username","password"); if (!$con) { die('Could not connect: ' . mysql_error()); } if(isset($_GET['id'])) { $id=$_GET['id']; mysql_select_db("db_name", $con); $result = mysql_query("SELECT * FROM comments WHERE article = '".$row['title']."' AND approved = 'YES'"); while($row = mysql_fetch_array($result)) { echo $row['name'] . " " . $row['email']; echo "<br />"; } }
  9. yes i know, and how would be the query for it? Here is the tables: table comments: - id; - name; - email; - message; -id_article; table articles: -id; - title; - contents;
  10. The title given is a unique name and are the same name in the coment and article
  11. Could someone tell me what is the query for what im trying to do, for example: i have 2 tables, one is "comments" table and the other is "articles" tables. In the comments table there is a 3 columns (id, title, message) and in the articles table there is 3 columns too(id, title,info) I would like is to get all the data of the column message from the table "comments" but the table "comments" got to have the same title of the column title of the column title of Articles table. I dont no if im beign confusing, im sorry.
  12. Hello there, im trying to validate in input text are but i liked to dont let the user insert emails or website links, and for this i think ill do this based in charecters or words like "@" and ".com,.org,etc.." How can i make it in my code? Here is my code if(document.getElementById("presentation").value.length < 10) { document.getElementById("presentation").style.border = '1px solid red'; alert('You cannot insert emails or website links.'); return false; } else { document.getElementById("presentation").style.border = '1px solid green'; return true; } Best regards
  13. im sorry, for better understanding herte it is full code <?php $qry=mysql_query("SELECT * FROM category", $con); if(!$qry) { die("Query Failed: ". mysql_error()); } ?> <form action="article_created.php" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table align="center"> <tr valign="baseline"> <td nowrap align="right" valign="top"> </td> <td>Categoria Produto Espanish</td> </tr> <tr valign="baseline"> <td nowrap align="right" valign="top"> </td> <td><select name="category" id="category"> <?php while($row=mysql_fetch_array($qry)) { echo "<option value='".$row['category']."'>".$row['category']."</option>"; } ?> </select> </td> </tr> <tr valign="baseline"> <td nowrap align="right" valign="top"> </td> <td>Category Produtc Ingles</td> </tr> <tr valign="baseline"> <td nowrap align="right" valign="top"> </td> <td><select name="category_en" id="category_en"> <?php while($row=mysql_fetch_array($qry)) { echo "<option value='".$row['category_en']."'>".$row['category_en']."</option>"; } ?> </select></td> </tr>
  14. Hello there, i have a table called "category" that haves 2 columns, that are "category" and "category_en" And im echo the list of data that i have, i can make the listins of columns "category appear but not the data of category_en . Take a look in my code please $qry=mysql_query("SELECT * FROM category", $con); if(!$qry) { die("Query Failed: ". mysql_error()); } <?php while($row=mysql_fetch_array($qry)) { echo "<option value='".$row['category']."'>".$row['category']."</option>"; } ?> <?php while($row=mysql_fetch_array($qry)) { echo "<option value='".$row['category_en']."'>".$row['category_en']."</option>"; } ?>
×
×
  • 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.