Jump to content

irvieto

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Everything posted by irvieto

  1. Hi Use mysql CONCAT() function to retrieve the data already formated. You should really fix table in order to have only 1 column of type date and remove the other 3 columns. In php the dot character is the concatenation symbol. example: echo 'Foo'.'-'.'bar'; //prints "Foo-bar"
  2. where are you catching $_POST values? e.g. $my_val = $_POST['some_field']; Also, avoid the use of mysql_result. use one mysql_fetch_array call.
  3. Hi.. Would you post the setEventVars() method and in what line are you appending it..
  4. Acording to the rules of integers syntax http://php.net/manual/en/language.types.integer.php, numbers in format of 0[0-9]+ are considered in octal. So intval(00000000000001525553) is being parsed as From right to left... 3*(8^0) + 5*(8^1) + ... the rest we know.. which gives the magical number of 437099. Have a nice day!
  5. Hi. So.. let me guess what you have.. a calendar table (id, start_date, end_date, id_type_of_item, title, etc..) and a students table. I think the "id_type_of_item" (1-Grade, 2-club, 3-homework,4- God knows what else...) will solve this issue. Now, how is the relationship between students and the items? Is there only grade per student or multiple?
  6. Hi. I do not understand the question. What do you mean with erase the checkbox?
  7. Search at google for phpMailer Class. It will allow you to attach files.
  8. User a recursive function to list the files in the subdirectories.. function read_directory($dir_path){ if ($handle = opendir('.')) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { if( is_dir($file) ){ read_directory($file); } else { echo "$file\n"; } } } closedir($handle); } } read_directory('/path/to/my/dir'); i didnt check the syntax but it should work.
  9. Change in the previous statement for: " set v_page = concat(v_page,'$visitor_page') "
  10. in Jquery, the .html() method gives you the inner text. Example: <div id="hello">World!</div> <script type="text/javscript"> var div_content = $("#hello").html(); window.alert(div_content); /*displays: World!*/ </script>
  11. Are tryin to assign the value of $visitor_page to the column "v_page" where visitor_ip = '$visitor_ip' AND visitor_date = '$visitor_day' or just read the data from the table? In case of assign. Use an update $sql_con = "update 'my_table' set v_page='$visitor_page.' where visitor_ip = '$visitor_ip' AND visitor_date = '$visitor_day';
  12. Hi. It is a HTML-javascript issue. "page_data" is just the id of the textarea (a html object). page_data.value will give you the text. Try: onclick="saveData(<?=$page_id?>, <?=$location_id?>, <?=$attribute_id?>, page_data.value);"
  13. Hi there. What about a regular expression for the substring lookup? http://php.net/manual/en/function.preg-match-all.php
  14. Hi. First of all, use proper html tags. <option value="some_val">Some text</option>. Then, check your $_POST to see what is the information you are receiving.. print_r($_POST);
  15. Cuidado...Carefull if ($test = 0) { //$test == 0 <--Esto es lo correcto. echo 'Error en peticion mysql'; } TambiƩn hay que revisar el foreach. <?php /* El valor de $arr luego de obtener el resultado con fetch_array es un array asociativo.... no hay necesidad de un foreach. $arr = array( 'page' =>'algun valor..', 'link' => 'otro valor' ); Al ejecutar el foreach, $items obtiene el valor: */ foreach ($arr as $items){ //$items = 'algun valor..'; <-- } ## # Usted ocupa algo como lo siguiente... ## while( $arr = mysql_fetch_array($resultado) ){ echo '<li><a href="'.$arr['link'].'">'.$arr['page'].'</a></li>'; } ?>
  16. following your example... document.getElementById('text').innerHTML = httpObject.responseText;
  17. Try using DOM methods to parse XML... childNodes, firstchild.. etc.. http://www-128.ibm.com/developerworks/library/x-ffox3/?ca=dgr-btw01XMLinFirefox3
  18. Sure. No problem. <?php $style_req = array('name'=>'','email'=>'' ,'phone'=>'' ); if( isset($_POST) ){ //Start Validations.. $err = 0; //Let's think everything is ok. if( trim($_POST['name'])=="" ){ $err = 1; // well, we found an error... $style_req['name'] = 'class="required"'; } if( trim($_POST['phone'])=="" ){ $err = 1; $style_req['phone'] = 'class="required"'; } #### # If an error is found, let the page load, it will show the labels with another style... ### if( $err==0 ){ //No errors //do something } } //isset... ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled</title> <style type="text/css"> <!--required fields with invalid data will have a label color "#CC3333" , etc. --> .required{ color:#CC3333; font-weight:bold; } </style> </head> <body> <form name="form1" method="post" action=""> <label <?php echo $style_req['name']; ?> >Name:</label> <input name="name" type="text" id="name"> <br> <br> <label <?php echo $style_req['email']; ?> >Email:</label> <input name="email" type="text" id="email"> <br> <br> <label <?php echo $style_req['phone']; ?>>Phone:</label> <input name="phone" type="text" id="phone"> <br> <br> <label>Gender:</label> <select name="select"> <option>Male</option> <option>Female</option> </select> <br> <br> <input type="submit" name="Submit" value="Submit"> </form> </body> </html> To validate the email address, you can use the getmxrr function. ( http://cr.php.net/manual/en/function.getmxrr.php ) but only works on Unix/linux systems. Hope this helps.
  19. Hi. Create a "required" style. Then after checking the $_POST, you detect those invalid fields. The code could be something like this.. <?php //Default style is empty.. $style_req = array('name'=>'','email'=>'' ,'phone'=>'' ); /* Post checking...etc. if name is invalid... => $style_req['name'] = 'class="required"'; */ ?> <body> <form name="form1" method="post" action=""> <label <?=$style_req['name']; ?>>Name:</label> <input name="name" type="text" id="name"> <br> ....
  20. Why not to make a small code in the form page to check if the form should be viewable or not? By doing that, you are preventing users to access the form and redirecting them.. something like this. <?php $sql = "select 1 from some_table where id_form='x' and valid_date=curdate()"; // In case of a 1 day form; ///bla bla.. if( $num_rows>0 ){ //date is ok, show the form, } else { header("Location:other_page.html"); } ?>
  21. there are a few javascript codes that prevent right clicking and other kind of keyboard events. The disadvantage is that is javascript and any user can disable javascript from their browser. Another option could be to make images with text, or using flash objects, but it will make your website bigger for such a silly thing like that.
  22. Use server side includes, or a external javascript file to automatically post your footer on all your web pages.
×
×
  • 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.