Jump to content

web_master

Members
  • Posts

    419
  • Joined

  • Last visited

Everything posted by web_master

  1. Hi, I got a problem, and I don't know where is a problem. <?php $TextUpload = $_POST['area1']; $TextUpload = str_replace(" "," ", $TextUpload); $TEXTAREAPreg = $TextUpload; $Replacement['0'] = '/\\\"(.*?)\\\"/'; $Replacement['1'] = '/\\\'/'; $Replacement['2'] = '–'; $Replaced['0'] = '„$1”'; $Replaced['1'] = '’'; $Replaced['2'] = '—'; $NoPregText = preg_replace($Replacement, $Replaced, $TEXTAREAPreg); ?> When I put the text in database without quotes (eg: text) than is OK, but when I put text between quotes (eg: "text"), than it's don't go into database... So, can You help me what I'm do wrong? Thnxs
  2. I dont know what is the name, because I see only messages Undeclared variable: "0" or Undeclared variable: "4"
  3. This a pagination script, and when I go on first page (load) then error is Undeclared variable: "0". As You see there is a 4 "loads" per page, and when I go to the next page (click on li) then the error is Undeclared variable: "4"... I hope it is understable...
  4. hi, I find a script for a pagination on internet. I cant find the problem, because I got error message "Undeclared variable" <?php $per_page = '4'; //getting number of rows and calculating no of pages $QueryReturn = mysql_query(' SELECT * FROM `aktualis` '); if(!$QueryReturn){ echo mysql_error(); exit; } $count = mysql_num_rows($QueryReturn); $pages = ceil($count/$per_page); ?> <script type="text/javascript"> $(document).ready(function(){ //Display Loading Image function Display_Load() { $("#loading").fadeIn(900,0); $("#loading").html("<img src='images/bigLoader.gif' alt='loader' />"); } //Hide Loading Image function Hide_Load() { $("#loading").fadeOut('slow'); }; //Default Starting Page Results $("#pagination li:first").css({'color' : '#FF0084'}).css({'border' : 'none'}); Display_Load(); $("#content").load("contents/data_aktualis.php?page=1", Hide_Load()); //Pagination Click $("#pagination li").click(function(){ Display_Load(); //CSS Styles $("#pagination li") .css({'border' : 'solid #dddddd 1px'}) .css({'color' : '#0063DC'}); $(this) .css({'color' : '#FF0084'}) .css({'border' : 'none'}); //Loading Data var pageNum = this.id; $("#content").load("contents/data_aktualis.php?page=" + pageNum, Hide_Load()); }); }); </script> <div id="loading" ></div> <div id="content" ></div> <ul id="pagination"> <?php //Show page links for($i=1; $i<=$pages; $i++) { echo '<li id="'.$i.'">'.$i.'</li>'; } ?> </ul> and this is the data file: <?php $per_page = '4'; if($_GET) { $page=$_GET['page']; } $start = ($page-1) * $per_page; $QueryReturn = mysql_query(' SELECT * FROM `aktualis` WHERE `aktualis_delete` = 0 ORDER BY `aktualis_id` LIMIT `"' . $start . '"`,`"' . $per_page . '"` DESC '); if(!$QueryReturn){ echo mysql_error(); exit; } while($request = mysql_fetch_array($QueryReturn)) { echo ... } ?> Thnx in advanced for help
  5. The problem is that there is a people who speak Hungarian language, and many of are they don't know english language. I will try jQuery. Thanx requinix, thanx TheKiller. T
  6. What? The message is provided by the browser. If you don't like how the browser is doing that then you'll have to do it yourself. what is the solution for that? (php... or other)
  7. Hi, I'm trying to learn html5 and I got a problem.... I want to use: <input type="email" id="email" name="email" placeholder="xxx@xxx.com" required="required"> When I leave the form empty after submit, there is a message like: "Please fill out this field". So is there any solution to this message become on other language? (and maybe the other messages works with form in HTML5) Thnx in advanced T
  8. Hi, I still have a problem. How can I check availabiliti from database with JavaScript: Jscript: var xmlhttp function showHint(sifrad) { if (sifrad.length==0) { document.getElementById("message_sifrad").innerHTML=""; return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="js/check_artikli_sifrad.php"; url=url+"?w="+sifrad; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=showMessage; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function showMessage() { if (xmlhttp.readyState==4) { document.getElementById("message_sifrad").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } php file: <?php //get the q parameter from URL $q = $_GET['w']; //lookup all hints from array if length of w>0 if (strlen($w) >= 3) { $getid1 = mysql_query("SELECT * FROM `p_artikli` WHERE `p_artikli_sifrad` = '$w'"); $getid_row1 = mysql_num_rows($getid1); if($getid_row1 > 0) { $response1 = '<img src="media/aviable_NOT_icon1.gif" alt="not aviable">'; } else { $response1 = '<img src="media/aviable_icon1.gif" alt="aviable">'; } } //output the response echo $response1; ?> html script (form for check): <div class="cont_form_right"><input type="text" name="p_artikli_sifrad" value="<?php echo $REQUEST['p_artikli_sifrad'];?>" onkeyup="showHint(this.value)" class="form_name" /><div id="message_sifrad" class="cont_form_aviable_not"></div> ------------------------ But I want to check the another data check from database, mean another column... T
  9. $Querylog = mysql_query(' SELECT p_users.p_users_id, p_users.p_users_nick, p_users_log.p_users_log_id, p_users_log.p_users_log_user, p_users_log.p_users_log_datetime FROM p_users Inner Join p_users_log ON p_users.p_users_id = p_users_log.p_users_log_user ORDER BY `p_users_log_user` ASC '); if(!$Querylog){ echo mysql_error(); exit; } while($request_log = mysql_fetch_array($Querylog)) { }
  10. Yes, I want to JOIN tables, thats OK, but after JOIN when I list its looks like this: Name 1 - log 1 Name 1 - log 2 Name 1 - log 3 Name 2 - log 1 Name 2 - log 2 Name 2 - log 3 ....
  11. Hi, I got a problem with two tables. There is a one with users, and the other is with logs of the users. USERS table - ID - name LOGS table - ID - users_ID - log_datetime I want to list this tables like this Name 1 - log_datetime - log_datetime - log_datetime... Name 2 - log_datetime - log_datetime - log_datetime... Name 3 - log_datetime - log_datetime - log_datetime... So, every names just one time, and below every log belong to that name... Thanks.. T
  12. hi, here is a partial solution of my problem: <div class="tarto"> <input type="text" id="kom_1" name="quantity_01" value="" /> <input type="text" id="cena_1" name="price_01" value="" /> <span class="res_01"> </span> </div> <script type="text/javascript"> $('.tarto input').keyup(function() { var id = $(this).attr('id').split('_'); $('.res_'+id[1]).html($('input[id="kom_'+id[1]+'"]').val() * $('input[id="cena_'+id[1]+'"]').val()); }); </script> When I type (keyup) the values in id="kom_1" and id="price_01" I will see the multiple result in <span class="res_01">. - The first problem is that I want to see result only in 2 decimals. - The second problem is: after submit in place <span class="res_01"></span> I want to reload data from database, but if I modify values in "input" form I want to see the typed result... I hope it is clear what I want (my english is not a best). thnxs T
  13. in meantime, i find a script, but with problem... at first: <head> <script type="text/javascript" src="js/jquery.min.js"></script> </head>... <input type="text" id="quantity 01" name="quantity_01" value="" /> <input type="text" id="price 01" name="price_01" value="" /> <span class="res_01"> </span> <script type="text/javascript"> $('input[id~=quantity], input[id~=price] ').keyup(function() { var id = $(this).attr('id').split(' '); $('.res_'+id[1]).html($('input[id="quantity '+id[1]+'"]').val() * $('input[id="price '+id[1]+'"]').val()); }); </script> the problem is that is not a valid, because of space in id attribute. Is some way to change id attr. to be without space (quantity_01 or quantity-01...)? thnxs
  14. Ok, as I know the Ajax is a javascript - but I don't know the real differences... so if I can solve my problem with javascript, than I need the javascript script ... thnxs
  15. hi, I got a problem, I want to multiply two numbers "on the fly" with ajax. There is a two forms, the firs form is the quantity and the second is the price. Example: <input type="text" id="quantity_01" name="quantity_01" value="" /><input type="text" id="price_01" name="price_01" value="" /> <input type="text" id="quantity_02" name="quantity_02" value="" /><input type="text" id="price_02" name="price_02" value="" /> <input type="text" id="quantity_03" name="quantity_03" value="" /><input type="text" id="price_03" name="price_03" value="" /> ... so, after when I input the quantity_01 and price_01 value, I want to see the multiply summary of those two values (exmpl. 10 * 15,00 = 150,00), without any reload. I'm a newbee in Ajax, so, please, give me some script, how can I do this? In advanced thnxs T
  16. Hi, Im a newbee in ajax, and I find a script for a "live" check is some numbers available in database. Mean, when a typing a numbers in form they tell me is that number is in database or not. The problem is that I have a 2 or more forms, and I must to check each other separately. here is the script that I have, and I dont know how can I do that? JS script: var xmlhttp function showHint(str) { if (str.length==0) { document.getElementById("message1").innerHTML=""; return; } xmlhttp=GetXmlHttpObject(); if (xmlhttp==null) { alert ("Your browser does not support XMLHTTP!"); return; } var url="JavaSript/check_nr/check_f_sifra.php"; url=url+"?q="+str; url=url+"&sid="+Math.random(); xmlhttp.onreadystatechange=showMessage; xmlhttp.open("GET",url,true); xmlhttp.send(null); } function showMessage() { if (xmlhttp.readyState==4) { document.getElementById("message1").innerHTML=xmlhttp.responseText; } } function GetXmlHttpObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } here is a PHP script (check_f_sifra.php): //get the q parameter from URL $q = $_GET['q']; //lookup all hints from array if length of q>0 if (strlen($q) >= 2) { $getid = mysql_query("SELECT * FROM `farm` WHERE `farm_sifrafc` = '$q'"); $getid_row = mysql_num_rows($getid); if($getid_row > 0) { $response = '<img src="Media/aviable_NOT_icon.gif" alt="not aviable">'; } else { $response = '<img src="Media/aviable_icon.gif" alt="aviable">'; } } //output the response echo $response; So in xhtml file is look like this: <div class="RightContainer"><input type="text" id="SifraFC" name="farm_sifrafc" value="<?php echo $_POST['farm_sifrafc'];?>" onkeyup="showHint(this.value)" maxlength="10" class="SifraFC" /><div id="message1" class="sifraOK"></div></div> I want to check another form (input) in the same file.... T
  17. hi everyone, I need upload a big files on server with PHP. I find one „solution” on internet and that is sending file via FTP with php. I try it but its dont work. Maybe there is no given a passive mode... but the scrip wont connect to ftp. Uploading big file using FTP is a good method? Or is there some other (simple) solution to upload big files with php? here is the script what I try to use <?php ob_start(); if (isset($_POST['submitted'])) { // get FTP access parameters $host = 'localhost'; $user = 'user'; $pass = 'password'; $destDir = 'public_html/video'; $workDir = 'public_html/tmp'; // define this as per local system // get temporary file name for the uploaded file $tmpName = basename($_FILES['file']['tmp_name']); // copy uploaded file into current directory move_uploaded_file($_FILES['file']['tmp_name'], $workDir."/".$tmpName) or die("Cannot move uploaded file to working directory"); // open connection $conn = ftp_connect($host) or die ("Cannot initiate connection to host"); // send access parameters ftp_login($conn, $user, $pass) or die("Cannot login"); // perform file upload $upload = ftp_put($conn, $destDir."/".$_FILES['file']['name'], $workDir."/".$tmpName, FTP_BINARY); // check upload status // display message if (!$upload) { echo "Cannot upload"; } else { echo "Upload complete"; } // close the FTP stream ftp_close($conn); // delete local copy of uploaded file unlink($workDir."/".$tmpName) or die("Cannot delete uploaded file from working directory -- manual deletion recommended"); } ?> <form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> File <br /> <input type="file" name="file" /><p /> <input type="submit" name="submit" value="Upload File" /> <input type="hidden" name="submitted" value="TRUE" /> </form> <?php ob_end_flush(); ?> thanks in advanced T
  18. Hi, I got a problem with Joining tables. I dont know what is the solution, please help me. SELECT `x700`.x700_id, `x700`.x700_radninalog, `x700`.x700_worker, `x700`.x700_notworker, user.user_id, user.user_name, user.user_formname FROM `x700` Inner Join user ON user.user_id = `x700`.x700_worker AND user.user_id = `x700`.x700_notworker The problem is that the `x700_worker` and the `x700_notworker` is taken from the `user` table. How can I separate that I can print on screen the workers name (x700_worker) and the "notworker"-s (x700_notworker) name too? thanks in adwanced, T
  19. Hi, Im totaly new in Ajax. But... when somebody register and typing the email address in form, I want to check this email is egsist in database? Is some simple script for this? Thanx T
  20. Hi, I got problem, how can I summary values in query? In column `table_values` are different values (example; 10, 15, 24...) $Query = mysql_query('SELECT * FROM `table` ORDER BY `table_id`'); if(!$Query) {echo mysql_error(); exit;} while($REQUEST = mysql_fetch_array($Query)) { $Values = $REQUEST['table_value']; } How can I summary values from rows? (10 + 15 + 24 = 49) Thnxs
  21. That mean that I must to give unique id to submit button? T
  22. Hi, I dont know what doing wrong <form ... <?php if($_POST['DeleteActor']) { mysql_query( 'DELETE FROM `n_dramaact` WHERE `n_dramaact_id` = "' . $_POST['n_dramaact_id'] . '"'); } // Reload from dBase $QueryDramActReturn = mysql_query( 'SELECT `n_dramaact`.`n_dramaact_id`, `n_dramaact`.`n_dramaact_dramid`, `n_dramaact`.`n_dramaact_dramact`, `n_actor`.`n_actor_id`, `n_actor`.`n_actor_fname`, `n_actor`.`n_actor_name`, `n_drama`.`n_drama_id`, `n_drama`.`n_drama_title` FROM `n_dramaact` Inner Join `n_actor` ON `n_actor`.`n_actor_id` = `n_dramaact`.`n_dramaact_dramact` Inner Join `n_drama` ON `n_drama`.`n_drama_id` = `n_dramaact`.`n_dramaact_dramid` WHERE `n_drama`.`n_drama_id` = "' . $REQUEST['n_drama_id'] . '" ORDER BY `n_actor_fname` ASC '); // Check query if(!$QueryDramActReturn) { echo mysql_error(); exit; } // Request query while($REQUESTDR = mysql_fetch_array ($QueryDramActReturn)) { ?> <div style="display: block; float: left; margin-left: 5px; margin-bottom: 5px;"> <?php echo $REQUESTDR['n_actor_fname'] . ' ' . $REQUESTDR['n_actor_name'];?> <input type="submit" name="DeleteActor" value="<-X" class="SubmitDelActor" /> <input type="hidden" name="n_dramaact_id" value="<?php echo $REQUESTDR['n_dramaact_id'];?>" /> </div> <?php }?> ....</form> I dont understand why when a push one of the listed DeleteActor submit button delete the last n_dramaact_id from table - every listed Submit button have the own (hidden) n_dramaact_id? thanx in advanced T
  23. Hi, I have a question. is that code below made a problem in google search, mean if I put this codes in header did google find my homepage? header( 'Cache-Control: no-store, no-cache, must-revalidate' ); header( 'Cache-Control: post-check=0, pre-check=0', false ); header( 'Pragma: no-cache' ); header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); Thnx. T
  24. I try this... but its not good... // Reload from dBase $QueryReturn2 = mysql_query( 'SELECT `refgroup`.`refgroup_id`, `refgroup`.`refgroup_name_sr`, `references`.`references_group`, `references`.`references_id`, `references`.`references_txt_sr`, `refpodgroup`.`refpodgroup_id`, `refpodgroup`.`refpodgroup_name_sr`, `references`.`references_podgroup` FROM `references` Inner Join refgroup ON refgroup.refgroup_id = `references`.references_group Inner Join refpodgroup ON refpodgroup.refpodgroup_id = `references`.references_podgroup GROUP BY `references`.`references_group` ORDER BY `refgroup_id` ASC '); // Check query if(!$QueryReturn2) { echo mysql_error(); exit; } // Request query while($REQUEST = mysql_fetch_array ($QueryReturn2)) { echo 'GRUPA ' . $REQUEST['refgroup_name_sr'] . '<br />'; echo '- ' . $REQUEST['refpodgroup_name_sr'] . '<br />'; echo $REQUEST['references_txt_sr'] . '<br />'; } Its show me: I GROUP (refgroup) - Undergroup (refpodgroup) 1. Txt (references) II GROUP (refgroup) - Undergroup II (refpodgroup) 1. Txt (references) There is a more than One "references" that belong to "refpodgroup" and "refgroup" So I want to looks like this I GROUP (refgroup) - Undergroup (refpodgroup) 1. Txt (references) 2. Txt (references) 3. Txt (references) ... II GROUP (refgroup) - Undergroup II (refpodgroup) 1. Txt (references) 2. Txt (references) 3. Txt (references)...
×
×
  • 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.