Jump to content

greg

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by greg

  1. interpim, Thank you. Actually the files are not in DB. They are all files from the root and other folders hosted in the server. I wish to write something like this, but I really don't know too much about php. I saw something similar sometime ago but can't find out now. Thanks for your help greg
  2. I'm looking for an script that will notify me by email when any website file change it's date, size, etc. Thanks Greg
  3. Hello guys, I have saw before this, but I can't find it now. I'm looking for an script that will notify me by email or log file when any server file change. Thanks Greg
  4. Does anyone knows an script that will read url's from a file and check if these websites exist? thanks greg
  5. Thank you. The code works correctly in IE. In Netscape and FireFox it displays this alert: alert("Problem retrieving data:" + xmlhttp.statusText) I know this is correct. If document.getElementById('T1').innerHTML=xmlhttp.getAllResponseHeaders() does not work, it should give the alert, but I want know is if there is anyway to make the code compatible with Netscape and FF so I can get the page load time from then as I get it from IE. Thank you for your time.
  6. I have the following code to get the Page Load Time from visitors. I get this var passed to php thru XMLHttpRequest and write the log. Everything in Internet Explorer works good, however in Netscape (7.2 tested) and FireFox (2.0.0.1 tested) it does not work. I don't have too much experience in these languages, could anyone give me some ideas about what should I do to get this code works in these browsers? Thank you! Greg <SCRIPT LANGUAGE="JavaScript"> var referer = "<?= $referer ?>"; //referer var ip = "<?= $b_ip ?>"; // ip address var uri = "<?= $uri ?>"; // url requested var lang = "<?= $b_lang ?>"; // language var width = screen.width; var height = screen.height; if (typeof(PLT_BackColor)=="undefined") PLT_BackColor = "white"; if (typeof(PLT_ForeColor)=="undefined") PLT_ForeColor= "black"; if (typeof(PLT_DisplayFormat)=="undefined") PLT_DisplayFormat = "%%S%% "; if (typeof(PLT_FontPix)=="undefined") PLT_FontPix = "12"; if (typeof(PLT_DisplayElementID)=="undefined") PLT_DisplayElementID = ""; dt=new Date(); document.onreadystatechange=function() { if (document.readyState=="complete") { if ((PLT_Span=document.getElementById(PLT_DisplayElementID)) == null) { document.body.insertBefore(document.createElement("br")); PLT_Span = document.body.insertBefore(document.createElement("span")); } PLT_DisplayFormat = PLT_DisplayFormat.replace(/%%S%%/g, ((new Date() - dt)/1000)); PLT_Span.style.Color = PLT_ForeColor; PLT_Span.style.backgroundColor = PLT_BackColor; PLT_Span.style.fontSize = PLT_FontPix + "px"; PLT_Span.innerText = PLT_DisplayFormat; } } </SCRIPT> <script type="text/javascript"> var xmlhttp dt=new Date(); function loadXMLDoc(url) { xmlhttp=null // code for Mozilla, etc. if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest() } // code for IE else if (window.ActiveXObject) { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP") } if (xmlhttp!=null) { xmlhttp.onreadystatechange=state_Change xmlhttp.open("GET","log_write.php?date=" + PLT_DisplayFormat + " | " + ip + " | " + dt + " | " + referer + " | " + width + " x " + height + " | " + navigator.appName, true) xmlhttp.send(null) } else { alert("Your browser does not support XMLHTTP.") } } function state_Change() { // if xmlhttp shows "loaded" if (xmlhttp.readyState==4) { // if "OK" if (xmlhttp.status==200) { document.getElementById('T1').innerHTML=xmlhttp.getAllResponseHeaders() } else { alert("Problem retrieving data:" + xmlhttp.statusText) } } } </script> </head> <body onload="loadXMLDoc('images/infobox/finished.gif')">
  7. Thank you Jesirose. Do you know of any place I can get an idea of how it can be done. I have never worked with AJAX before. This is the javascript code I use for this. [CODE] dt=new Date(); document.onreadystatechange=function() {   if (document.readyState=="complete") {     if ((PLT_Span=document.getElementById(PLT_DisplayElementID)) == null) {       document.body.insertBefore(document.createElement("br"));       PLT_Span = document.body.insertBefore(document.createElement("span")); }     PLT_DisplayFormat = PLT_DisplayFormat.replace(/%%S%%/g, ((new Date() - dt)/1000));     PLT_Span.style.Color = PLT_ForeColor;     PLT_Span.style.backgroundColor = PLT_BackColor;     PLT_Span.style.fontSize = PLT_FontPix + "px";     PLT_Span.innerText = PLT_DisplayFormat;   } } [/code]
  8. Hello Everyone, This seems so simple, but I can't figure it out. What I need is to record the real page load time of every webpage for every visitor. Firstly, I have tried to calculate the time using php, but as this is server side, I can only record the time spent on running the code, not the actual time the webpage loads in the visitor browser. Secondly, I have used javascript, and it works ok, the only problem I can’t do anything with that number. I can’t write it in the database, I can’t write it in a log file, I can’t send it by email, etc. I understand this is because when the visitor does the request, php runs first, them javascript. I need someone give a hand on this. I would like either record every time in the database, or write a log file, or send an email (this is not so good because I will get lot of emails). If anyone knows some software to do this, please post here the name. Please help me. I’m stuck with this project for about a week now. Thanks
  9. Yes, the code does not give me errors. Your change works perfectly! Thank you for your help greg
  10. Hi, I have a folder named "picture" with pictures of each member. Some members has one pic, others has more than one. I also have a table named "member_picture" with the file name that correspond to each member. In the following code, I want to display the member images in the second row ($row["pic"]). Thank you for your help. greg [CODE] $sql="select u.id, u.name, u.number, u.accept, p.pic, p.id from member_user u left join member_picture p on u.id=p.id where u.accept=1"; $results=mysql_query($sql); $rows=mysql_num_rows($results); if ($rows==0) $cont.='<tr><td class="bodytxt" align="center" colspan="2">There is no  existant member</td></tr>'; else { while ($row=mysql_fetch_array($results)) { $cont.='<tr> <td class="bodytxt" align="left"><a href="viewdetails.php?id='.$row["id"].'&nam='.$name.'"><b>'.$row["name"].'</b></a></td> <td class="bodytxt" align="left"> '.$row["pic"].'</b></a></td> <td class="bodytxt" align="center"><a href="denynew.php?id='.$row["id"].'"> deny </a></td> <td class="bodytxt" align="center"><a href="deletemember.php?id='.$row["id"].'" onClick="return confirm(\'Are you sure you want to delete this member?\');">delete</a></td> </tr>'; } } [/CODE]
  11. Hello, In this form, how can I go to the same page number when the results are more than one page? Thanks Greg [CODE] <form name="eachrow" action="visitors.php?listing=id-desc&page=" method="POST">           <input type="hidden" value="<?=$visitors['browser_id']?>" name="DeleteOneRow"> <td class="VisitorTableContent" align="center" valign="top"> <input type="submit" value="delete">           </form> [/CODE]
  12. Please, can anyone help me on this? Thanks
  13. Hello Everyone, The following code works good, only it doesn't make things the way I wanted. Let me explain. The table product_colors contains the colors for each product. Because most products has more than one color, there is several records for each product_id in this table. I'm trying to get all color_names for each product into one single line but this code makes a separate row for each color. It looks like: product_id      color 105                red 105                blue 105                black 106                yellow 106                black ...... And I want this: 105                red, blue, black 106                yellow, black, ..... Could anyone help me on this please? Thanks Greg [code]//=================================PRODUCT COLORS elseif (isset($HTTP_GET_VARS['product_color']) && tep_not_null($HTTP_GET_VARS['product_color'])) {       $keywords = tep_db_input(tep_db_prepare_input($HTTP_GET_VARS['product_color']));       $ProductModel = " and p.products_model like '%" . $keywords . "%'";     ?> <table width="670" class="infoBoxContents" BORDER="1" cellspacing="0" cellpadding="3"> <tr> <td colspan="4" class="infoBoxHeading" align="center"><b>Price List</b></td> </tr> <? $ProductPrice_query = "SELECT p.products_id, p.products_date_added, p.products_model, pd.products_name, p.products_quantity_order_min, p.products_discount4_qty, pc.products_id, pc.color_name FROM products p LEFT JOIN products_colors pc on p.products_id=pc.products_id LEFT JOIN products_description pd ON pc.products_id = pd.products_id WHERE p.products_date_added < '2006-01-01 01:01:05' and pd.language_id = '" . (int) $languages_id . "'" . $ProductModel . "ORDER by p.products_id DESC";     $ProductPrice_query = tep_db_query($ProductPrice_query);     while ($ProductPrice = tep_db_fetch_array($ProductPrice_query)) { echo "<table width='670' border='0'>"; echo "<tr class='infoBoxContent' valign='top'>"; echo "<td width='12%' align='left'>&nbsp".$ProductPrice["products_model"]."</td>\n";             echo "<td width='250' align='left'>&nbsp".$ProductPrice["products_name"]."&nbsp</td>\n"; echo "<td width='5' align='left'>&nbsp".$ProductPrice["products_id"]."&nbsp</td>\n"; echo "<td align='center' width='100' align='left'><b>&nbsp".$ProductPrice["products_quantity_order_min"]."&nbsp</b></td>\n"; echo "<td align='center' width='10%' valign='top'><b>&nbsp".$ProductPrice["color_name"]."</b></td>\n"; echo "<td align='center' width='10%'><b>&nbsp".$ProductPrice["color_name"]."</b></td>\n"; echo "<td align='center' width='10%'><b>&nbsp".$ProductPrice["p.products_date_added"]."</b></td>\n"; echo "<td align='center' width='10%'><b>&nbsp".$ProductPrice["products_discount4_qty"]."</b></td>\n";             echo "</tr>\n"; echo "</table>"; } }[/code]
  14. Orio, Thank you very much. It works perfectly. greg
  15. [quote author=Orio link=topic=99426.msg391513#msg391513 date=1152032413] I suggest you to leave only the "domain.com" part. In every check drop from both the http:// part and the www or subdomain part. Orio. [/quote] Orio, thank you for your answer. That's what I was thinking, but I don't know how to get it. Could you please elaborate a little bit on this? Thanks Greg
  16. Thank you for your post wildteen88 The problem I see using the substract is that domains are not equal in lenght, so what happens when the domain is i.e. www.1234.com? Thanks Greg
  17. Hello, I'm trying to validate a web page if this web page is from the same domain. I have used the following code, and it works perfect except when the web page to be validated is under a subdomain of the main domain. For example: domain: http://www.maindomain.com if the page is located at: http://www.maindomain.com/page1.php --------- is validated if the page is located at: http://subdomain.maindomain.com/page1.php ----- is not validated. Could anyone help me on this please. Thanks Greg [code] if ($preventOtherDomains = 'yes') { $lparseurl = @parse_url($_POST['url']); $rparseurl = @parse_url($_POST['links_url']); if ($lparseurl['host'] !== $rparseurl['host']) { $reciprocal_error_text_add = ' Must be from same domain.'; $reciprocal_error = true; }     } [/code]
  18. Hello, I have a calculation online form where the visitor put some data, click submit, and the calculations are displayed. I want to know how can I setup the form so I can get ALSO an email when the submit button is hitted? Thank you for your help. Greg Here is part of the code: [code] this is at the beginning of the form: <form name="estimator" action="<?php echo FILENAME_ESTIMATOR.'?pID='.(int)$HTTP_GET_VARS['pID'];?>" method="post" onsubmit="return checkForm(this);"> this is where the submit buttom is located: <input value="Generate Estimate" name="submit" style="font-family: verdana; font-size: 8pt;" type="submit">         <input value="Reset" name="reset" onclick="document.location = form.action;" style="font-family: verdana; font-size: 8pt;" type="button">           <input value="Close" name="close" onclick="window.close();" style="font-family: verdana; font-size: 8pt;" type="button"> [/code]
  19. Hello hitman6003, Oh my god! - Sorry for that long walk, it wasn't my intention. I appreciate your help, but can you elaborate a little bid for me please. The point is that I don't go so deep in php, so in other words, I'm starting. I need help please. thanks
  20. I use OScommerce, and the following code is the shopping cart content of a customer. What code should I need to convert this to normal view and display in a page. I really appreciate anyone's help. greg O:12:"shoppingcart":7:{s:8:"contents";a:1:{i:1024; a:2:{s:3:"qty";s:2: "72";s:11:"custom_data"; a:7:{s:10:"item_color";a:2:{s:10:"color_name";s:6:"Purple" ;s:10 :"color_code";s:7:"#912690";} s:7:"comment";s:0:"";s:12:"imprint_area" ;a:1:{i:3458;a:5:{s:7:"icolors";a:1:{i:0;s:14: "Purple:#a65692";}s:6:"colors";a:1:{s:6:"Purple";s:7 :"#a65692";}s:5:"lines";a:1:{i:1;a: 7:{s:4:"text";s:16:"SECOND LINE";s:9:" font_size";s:2:"10";s:11:"font_family";s:5: "Arial";s:4:"bold";s:1:"0";s:7:"italics"; s:1:"0";s:5:"align";s:4:"left";s:10:"font_color";a:2:{s:10:" color_name";s:6:"Purple";s:10:"color_code";s: 7:"#a65692";}}}s:4:"name";s:20: "Primary Imprint Area";s:5:"image";s:32
×
×
  • 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.