Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by mojito

  1. wow a talented 15 year old !!! will check out your site. But this still wont work, Im not explaining myself very well the url could be http://landed.at/Iraq http://landed.at/Skiing http://landed.at/flash I need that turning into ?country=Iraq..country=Skiing..country=flash for eample then I can redirect them to the relevant page. Thanks for your help this rewrite stuff is pretty tricky. Eventually I want to actually depending on this value (so I should keep it generic i.e. not country=) I would like to look it up in the database to see if its a country or town to save people typing in another level ie. http://landed.at/USA/miami but Im not sure many people will use the site like that anyway so the more simple country only version is what im initially after,helps to look further ahead. ps, your sites look good, do you work for money ? and what would be your hourly rate.
  2. Thanks the thing is they can type any one of 170 odd countries and other strings in there, depending on the content I decide to host. so that iraq string will be unknown..
  3. So far I have come up with RewriteRule ^landed\.at/(.*)$ /landed.at/index.php?country=$1 [L] and im testing with http://localhost/landed.at/iraq in the browser this isnt working on my localhost (using my CMS) but in a test folder (really nothing in there) it seems to work.
  4. Rewriting the query string, I need a correct method to go along with, maybe modrewrite is too complicated for what I need. The functionality I desire is that if someone types in http://www.landed.at/Iraq then the page wont try to find that directory it will set it up like http://landed.at/index.php?country=Iraq&Submit=Submit Im looking at mod_alias here http://httpd.apache.org/docs/2.2/mod/mod_alias.html and trying to see if its what I need ?
  5. have removed that still get the same error. Thanks for your help so far.
  6. thats why i didnt post the original code, wouldnt expect anyone to do that I wouldnt myself. the html is there its a select as <form id="cities" name="form2" method="post" action=""> <select name="sel2" onclick="javascript:setCity(sel2.value)"> </select> </form>
  7. Hi, now am getting the error getElementById undefined here is the page source <?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="alternate" type="application/rss+xml" title="ROR" href="ror.xml" /> <title>landed.at - Home</title> <meta name="description" content="Joomla - the dynamic portal engine and content management system" /> <meta name="keywords" content="Joomla, joomla" /> <meta name="Generator" content="Joomla! -" /> <meta name="robots" content="index, follow" /> <link rel="shortcut icon" href="http://localhost/landed.at/images/favicon.ico" /> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <link href="http://localhost/landed.at/templates/travel/css/template_css.css" rel="stylesheet" type="text/css"/> <script language="JavaScript" type="text/javascript" src="/script.js?beta4"></script> <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[ var smf_theme_url = ""; var smf_images_url = ""; var smf_scripturl = ""; var smf_session_id = ""; // ]]></script> <link rel="stylesheet" type="text/css" href="/style.css?rc1" /> <link rel="stylesheet" type="text/css" href="/print.css?beta4" media="print" /> <link rel="help" href="?action=help" target="_blank" /> <link rel="search" href="?action=search" /> <link rel="contents" href="" /> <style type="text/css"> <!-- .style3 {color: #333333} --> </style> </head> <body id="body"> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td class="header_left" valign="top"> <form action="index.php" method="post" name="login" > <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr> <td> <label for="mod_login_username"> Username </label> <br /> <input name="username" id="mod_login_username" type="text" class="inputbox" alt="username" size="10" /> <br /> <label for="mod_login_password"> Password </label> <br /> <input type="password" id="mod_login_password" name="passwd" class="inputbox" size="10" alt="password" /> <br /> <input type="checkbox" name="remember" id="mod_login_remember" class="inputbox" value="yes" alt="Remember Me" /> <label for="mod_login_remember"> Remember me </label> <br /> <input type="hidden" name="option" value="login" /> <input type="submit" name="Submit" class="button" value="Login" /> </td> </tr> <tr> <td> <a href="index.php?option=com_registration&task=lostPassword"> Lost Password?</a> </td> </tr> <tr> <td> No account yet? <a href="index.php?option=com_registration&task=register"> Register</a> </td> </tr> </table> <input type="hidden" name="op2" value="login" /> <input type="hidden" name="lang" value="english" /> <input type="hidden" name="return" value="/landed.at/" /> <input type="hidden" name="message" value="0" /> </form> </td> <td class="header_left" valign="top"> </td> <td class="header_right" valign="top"><div align="right"><a href="#"> [help]</a></div></td> </tr> <tr> <td class="header_left" valign="top"><img src="images/landed/logo_future00.gif" width="350" height="98" /> </td> <td class="header_left" valign="top"> </td> <td class="header_right"><div id="ajaxCountry"><div id="ajaxCity"></td> </tr><tr> <td colspan="3" bgcolor="#FFFFFF" ><p><a href="#"></a></p></td> </tr> <tr> <td class="header_left" colspan="3"><script type="text/javaScript" src="modules/mod_swmenufree/transmenu.js"></script> <style type="text/css"> <!-- .transMenu { position:absolute; overflow:hidden; left:-1000px; top:-1000px; } .transMenu .content { position:absolute; } .transMenu .items { border: 0px solid #FFFFFF; position:relative; left:0px; top:0px; z-index:2; } .transMenu.top .items { } .transMenu td { height:10px; padding: 5px 5px 5px 5px!important; font-size: 12px !important; font-family: Arial, Helvetica, sans-serif !important; text-align: center !important; font-weight: bold !important; color: #000000 !important; } .transMenu .item.hover td { color: #FFFFFF!important; } .transMenu .item { text-decoration: none; /* this is a hack for mac/ie5, whom incorrectly cascades the border properties of the parent table to each row */ cursor:pointer; cursor:hand; } .transMenu .background { background-color: #FFCC99!important; position:absolute; left:0px; top:0px; z-index:1; -moz-opacity:0.85; filter:alpha(opacity=85) } .transMenu .shadowRight { position:absolute; z-index:3; top:3px; width:2px; -moz-opacity:0.85; filter:alpha(opacity=85); background-color:#fff; } .transMenu .shadowBottom { position:absolute; z-index:1; left:3px; height:2px; -moz-opacity:0.85; filter:alpha(opacity=85) } .transMenu .item.hover { background-color: #FF6600; } .transMenu .item img { margin-left:10px; } table.menu { top: 0px; left: 0px; position:relative; margin:0px; border: 0px solid #16C9FE; } table.menu a{ margin:0px; padding: 5px 5px 5px 5px; display:block; position:relative; } div.menu a, div.menu a:visited, div.menu a:link { width:150px; height:10px; font-size: 12px; font-family: Arial, Helvetica, sans-serif; text-align: center; font-weight: bold; color: #FF9933; text-decoration: none; margin-bottom:0px; display:block; white-space:nowrap; } div.menu td { border-bottom: 1px none #FFC819; border-top: 1px none #FFC819; border-left: 1px none #FFC819; background-color: #ECFFFF; } div.menu td.last { border-right: 1px none #FFC819; } #menu a.hover { color: #FFFFFF; background-color: #BAFFFF; } --> </style> <div id="wrap" class="menu" align="center"> <table cellspacing="0" cellpadding="0" id="menu" class="menu" > <tr> <td> <a id="menu1" href="index.php?option=com_frontpage&Itemid=1" >Home</a></td> <td> <a id="menu49" href="index.php?option=com_smf&Itemid=49" >Forum</a></td> <td> <a id="menu9" href="index.php?option=com_content&task=blogsection&id=0&Itemid=9" >Blog</a></td> <td class='last'> <a id="menu27" href="index.php?option=com_journal&Itemid=27" >test calvin travel journal</a></td> </tr> </table></div> <script type="text/javascript"> <!-- if (TransMenu.isSupported()) { var ms = new TransMenuSet(TransMenu.direction.down, 0, 0, TransMenu.reference.bottomLeft); function init() { if (TransMenu.isSupported()) { TransMenu.initialize(); document.getElementById("menu1").onmouseover = function() { ms.hideCurrent(); this.className = "hover"; } document.getElementById("menu1").onmouseout = function() { this.className = ""; } document.getElementById("menu49").onmouseover = function() { ms.hideCurrent(); this.className = "hover"; } document.getElementById("menu49").onmouseout = function() { this.className = ""; } document.getElementById("menu9").onmouseover = function() { ms.hideCurrent(); this.className = "hover"; } document.getElementById("menu9").onmouseout = function() { this.className = ""; } document.getElementById("menu27").onmouseover = function() { ms.hideCurrent(); this.className = "hover"; } document.getElementById("menu27").onmouseout = function() { this.className = ""; } }} TransMenu.spacerGif = "http://localhost/landed.at/modules/mod_swmenufree/images/transmenu/x.gif"; // path to a transparent spacer gif TransMenu.dingbatOn = "http://localhost/landed.at/modules/mod_swmenufree/images/transmenu/submenu-on.gif"; // path to the active sub menu dingbat TransMenu.dingbatOff = "http://localhost/landed.at/modules/mod_swmenufree/images/transmenu/submenu-off.gif"; TransMenu.sub_indicator = true; TransMenu.menuPadding = 0; // padding between menu border and items grid TransMenu.itemPadding = 0; // additional padding around each item TransMenu.shadowSize = 2; // size of shadow under menu TransMenu.shadowOffset = 3; // distance shadow should be offset from leading edge TransMenu.shadowColor = "#888"; // color of shadow (transparency is set in CSS) TransMenu.shadowPng = "http://localhost/landed.at/modules/mod_swmenufree/images/transmenu/grey-40.png"; // a PNG graphic to serve as the shadow for mac IE5 TransMenu.backgroundColor = "#FFCC99"; // color of the background (transparency set in CSS) TransMenu.backgroundPng = "http://localhost/landed.at/modules/mod_swmenufree/images/transmenu/white-90.png"; // a PNG graphic to server as the background for mac IE5 TransMenu.hideDelay = 600; // number of milliseconds to wait before hiding a menu TransMenu.slideTime = 300; TransMenu.renderAll(); if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", init, false ); // IE else if ( typeof window.attachEvent != "undefined" ) { window.attachEvent( "onload", init ); //window.attachEvent( "onunload", disposeAllTabs ); } else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); init(); } } else window.onload = init(); } } --> </script> </td> </tr> <tr> <td colspan="3"></td> </tr> <tr> <td colspan="3"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script language="javascript"> <!-- function createRequestObject() { var req; if(window.XMLHttpRequest){ // Firefox, Safari, Opera... req = new XMLHttpRequest(); } else if(window.ActiveXObject) { // Internet Explorer 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // There is an error creating the object, // just as an old browser is being used. alert('Problem creating the XMLHttpRequest object'); } return req; } // Make the XMLHttpRequest object var http = createRequestObject(); function sendRequest(act) { //alert("fired "+act); //alert("send request"); // Open PHP script for requests http.abort(); http.open('post', 'modules/doit.php'); http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); http.send('country='+act); document.getElementById("ajaxCountry").innerHTML=act; // document.getElementById("ajaxTest").innerHTML=act; http.onreadystatechange = handleResponse; } function setCity(act){ document.getElementById("ajaxCity").innerHTML=act; } function handleResponse() { if(http.readyState == 4 && http.status == 200){ //alert("ajax loaded "+http.responseText); // Text returned FROM the PHP script var response = http.responseText; // var response ="text~value|text~value|text~value|text~value|"; if(response!="" || response != false) { alert("ok here rsponse = "+response); // UPDATE select box sel2 content sel = getElementById['cities'].sel2; //clear old content alert("ok here sel = "+sel); /* while (sel.options.length) { sel.remove(0); }*/ //split the incoming string to create array arrOpt which contians the pairs of content sel.options[0] = new Option("me","too"); /*var arrOpt = response.split("|"); alert("ok here arrOpt= "+arrOpt); for(var i = 0; i< arrOpt.length-1;i++){ var arrVal = arrOpt[i].split("~"); sel.options[sel.options.length] = new Option(arrVal [0],arrVal[1]); }*/ document.getElementById("ajaxTest").innerHTML ="response"; } else{ alert("response was equal to nowt ="+response); } } } //--> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> Please select a country from the drop down box below.<br><br><form id="places" action="/landed.at/" method="post" name="form01"><select size="10" name="sel1" onchange="javascript:sendRequest(sel1.value)"><option value="1">Afghanistan</option><option value="2">Albania</option><option value="3">Algeria</option><option value="4">American Samoa</option><option value="5">Andorra</option><option value="6">Angola</option><option value="7">Anguilla</option><option value="8">Antarctica</option><option value="9">Antigua and Barbuda</option><option value="10">Argentina</option><option value="11">Armenia</option><option value="12">Aruba</option><option value="13">Ashmore and Cartier</option><option value="14">Australia</option><option value="15">Austria</option><option value="16">Azerbaijan</option><option value="17">The Bahamas</option><option value="18">Bahrain</option><option value="19">Baker Island</option><option value="20">Bangladesh</option><option value="21">Barbados</option><option value="22">Bassas da India</option><option value="23">Belarus</option><option value="24">Belgium</option><option value="25">Belize</option><option value="26">Benin</option><option value="27">Bermuda</option><option value="28">Bhutan</option><option value="29">Bolivia</option><option value="30">Bosnia and Herzegovina</option><option value="31">Botswana</option><option value="32">Bouvet Island</option><option value="33">Brazil</option><option value="34">British Indian Ocean Territory</option><option value="35">British Virgin Islands</option><option value="36">Brunei Darussalam</option><option value="37">Bulgaria</option><option value="38">Burkina Faso</option><option value="39">Burma</option><option value="40">Burundi</option><option value="41">Cambodia</option><option value="42">Cameroon</option><option value="43">Canada</option><option value="44">Cape Verde</option><option value="45">Cayman Islands</option><option value="46">Central African Republic</option><option value="47">Chad</option><option value="48">Chile</option><option value="49">China</option><option value="50">Christmas Island</option><option value="51">Clipperton Island</option><option value="52">Cocos (Keeling) Islands</option><option value="53">Colombia</option><option value="54">Comoros</option><option value="55">Congo, Democratic Republic of the</option><option value="56">Congo, Republic of the</option><option value="57">Cook Islands</option><option value="58">Coral Sea Islands</option><option value="59">Costa Rica</option><option value="60">Cote d'Ivoire</option><option value="61">Croatia</option><option value="62">Cuba</option><option value="63">Cyprus</option><option value="64">Czech Republic</option><option value="65">Denmark</option><option value="66">Djibouti</option><option value="67">Dominica</option><option value="68">Dominican Republic</option><option value="69">East Timor</option><option value="70">Ecuador</option><option value="71">Egypt</option><option value="72">El Salvador</option><option value="73">Equatorial Guinea</option><option value="74">Eritrea</option><option value="75">Estonia</option><option value="76">Ethiopia</option><option value="77">Europa Island</option><option value="78">Falkland Islands (Islas Malvinas)</option><option value="79">Faroe Islands</option><option value="80">Fiji</option><option value="81">Finland</option><option value="82">France</option><option value="83">France, Metropolitan</option><option value="84">French Guiana</option><option value="85">French Polynesia</option><option value="86">French Southern and Antarctic Lands</option><option value="87">Gabon</option><option value="88">The Gambia</option><option value="89">Gaza Strip</option><option value="90">Georgia</option><option value="91">Germany</option><option value="92">Ghana</option><option value="93">Gibraltar</option><option value="94">Glorioso Islands</option><option value="95">Greece</option><option value="96">Greenland</option><option value="97">Grenada</option><option value="98">Guadeloupe</option><option value="99">Guam</option><option value="100">Guatemala</option><option value="101">Guernsey</option><option value="102">Guinea</option><option value="103">Guinea-Bissau</option><option value="104">Guyana</option><option value="105">Haiti</option><option value="106">Heard Island and McDonald Islands</option><option value="107">Holy See (Vatican City)</option><option value="108">Honduras</option><option value="109">Hong Kong (SAR)</option><option value="110">Howland Island</option><option value="111">Hungary</option><option value="112">Iceland</option><option value="113">India</option><option value="114">Indonesia</option><option value="115">Iran</option><option value="116">Iraq</option><option value="117">Ireland</option><option value="118">Israel</option><option value="119">Italy</option><option value="120">Jamaica</option><option value="121">Jan Mayen</option><option value="122">Japan</option><option value="123">Jarvis Island</option><option value="124">Jersey</option><option value="125">Johnston Atoll</option><option value="126">Jordan</option><option value="127">Juan de Nova Island</option><option value="128">Kazakhstan</option><option value="129">Kenya</option><option value="130">Kingman Reef</option><option value="131">Kiribati</option><option value="132">Korea, North</option><option value="133">Korea, South</option><option value="134">Kuwait</option><option value="135">Kyrgyzstan</option><option value="136">Laos</option><option value="137">Latvia</option><option value="138">Lebanon</option><option value="139">Lesotho</option><option value="140">Liberia</option><option value="141">Libya</option><option value="142">Liechtenstein</option><option value="143">Lithuania</option><option value="144">Luxembourg</option><option value="145">Macao</option><option value="146">Macedonia, The Former Yugoslav Republic of</option><option value="147">Madagascar</option><option value="148">Malawi</option><option value="149">Malaysia</option><option value="150">Maldives</option><option value="151">Mali</option><option value="152">Malta</option><option value="153">Man, Isle of</option><option value="154">Marshall Islands</option><option value="155">Martinique</option><option value="156">Mauritania</option><option value="157">Mauritius</option><option value="158">Mayotte</option><option value="159">Mexico</option><option value="160">Micronesia, Federated States of</option><option value="161">Midway Islands</option><option value="162">Miscellaneous (French)</option><option value="163">Moldova</option><option value="164">Monaco</option><option value="165">Mongolia</option><option value="166">Montenegro</option><option value="167">Montserrat</option><option value="168">Morocco</option><option value="169">Mozambique</option><option value="170">Myanmar</option><option value="171">Namibia</option><option value="172">Nauru</option><option value="173">Navassa Island</option><option value="174">Nepal</option><option value="175">Netherlands</option><option value="176">Netherlands Antilles</option><option value="177">New Caledonia</option><option value="178">New Zealand</option><option value="179">Nicaragua</option><option value="180">Niger</option><option value="181">Nigeria</option><option value="182">Niue</option><option value="183">Norfolk Island</option><option value="184">Northern Mariana Islands</option><option value="185">Norway</option><option value="186">Oman</option><option value="187">Pakistan</option><option value="188">Palau</option><option value="189">Palmyra Atoll</option><option value="190">Panama</option><option value="191">Papua New Guinea</option><option value="192">Paracel Islands</option><option value="193">Paraguay</option><option value="194">Peru</option><option value="195">Philippines</option><option value="196">Pitcairn Islands</option><option value="197">Poland</option><option value="198">Portugal</option><option value="199">Puerto Rico</option><option value="200">Qatar</option><option value="201">Réunion</option><option value="202">Romania</option><option value="203">Russia</option><option value="204">Rwanda</option><option value="205">Saint Helena</option><option value="206">Saint Kitts and Nevis</option><option value="207">Saint Lucia</option><option value="208">Saint Pierre and Miquelon</option><option value="209">Saint Vincent and the Grenadines</option><option value="210">Samoa</option><option value="211">San Marino</option><option value="212">São Tomé and Príncipe</option><option value="213">Saudi Arabia</option><option value="214">Senegal</option><option value="215">Serbia</option><option value="216">Serbia and Montenegro</option><option value="217">Seychelles</option><option value="218">Sierra Leone</option><option value="219">Singapore</option><option value="220">Slovakia</option><option value="221">Slovenia</option><option value="222">Solomon Islands</option><option value="223">Somalia</option><option value="224">South Africa</option><option value="225">South Georgia and the South Sandwich Islands</option><option value="226">Spain</option><option value="227">Spratly Islands</option><option value="228">Sri Lanka</option><option value="229">Sudan</option><option value="230">Suriname</option><option value="231">Svalbard</option><option value="232">Swaziland</option><option value="233">Sweden</option><option value="234">Switzerland</option><option value="235">Syria</option><option value="236">Taiwan</option><option value="237">Tajikistan</option><option value="238">Tanzania</option><option value="239">Thailand</option><option value="240">Togo</option><option value="241">Tokelau</option><option value="242">Tonga</option><option value="243">Trinidad and Tobago</option><option value="244">Tromelin Island</option><option value="245">Tunisia</option><option value="246">Turkey</option><option value="247">Turkmenistan</option><option value="248">Turks and Caicos Islands</option><option value="249">Tuvalu</option><option value="250">Uganda</option><option value="251">Ukraine</option><option value="252">United Arab Emirates</option><option value="253">United Kingdom</option><option value="254">United States</option><option value="255">United States Minor Outlying Islands</option><option value="256">Uruguay</option><option value="257">Uzbekistan</option><option value="258">Vanuatu</option><option value="259">Venezuela</option><option value="260">Vietnam</option><option value="261">Virgin Islands</option><option value="262">Virgin Islands (UK)</option><option value="263">Virgin Islands (US)</option><option value="264">Wake Island</option><option value="265">Wallis and Futuna</option><option value="266">West Bank</option><option value="267">Western Sahara</option><option value="268">Western Samoa</option><option value="269">World</option><option value="270">Yemen</option><option value="271">Yugoslavia</option><option value="272">Zaire</option><option value="273">Zambia</option><option value="274">Zimbabwe</option><option value="275">Palestinian Territory, Occupied</option></select></form><div id='ajaxTest'>ggg</div> <form id="cities" name="form2" method="post" action=""> <select name="sel2" onclick="javascript:setCity(sel2.value)"> </select> </form> <br /><br /> </body> </html> </td> </tr> <tr> <td colspan="3"> <div align="left"> <table width="100%" border="0" cellspacing="0" cellpadding="5"> <tr> <td width="700">There are no items to display</td> <td valign="top"> <div class="moduletable"> </div> </td> </tr> </table> </div> <br /> <div align="center" class="header_right"> (C) 2007 landed.at</div> <div align="center"> </div></td> </tr> <tr> <td class="header_left" colspan="3"><a href="http://www.tri-x-directory.com/">Tri-X-Directory</a> <script type="text/javascript"><!-- google_ad_client = "pub-5653652306821260"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; google_ad_channel = ""; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> <script language="javascript"> var uri = 'http://impgb.tradedoubler.com/imp/img/507633/1173511?' + new String (Math.random()).substring (2, 11); document.write('<a href="http://clkuk.tradedoubler.com/click?p=4506&a=1173511&g=507633" target="_blank"><img src="'+uri+'" border=0></a>'); </script> <div class="syndicate"> <div align="center"> <a href="index2.php?option=com_rss&feed=RSS0.91&no_html=1"> <img src="http://localhost/landed.at/images/M_images/rss091.gif" alt="RSS 0.91" align="middle" name="RSS_091" border="0" /></a> </div> <div align="center"> <a href="index2.php?option=com_rss&feed=RSS1.0&no_html=1"> <img src="http://localhost/landed.at/images/M_images/rss10.gif" alt="RSS 1.0" align="middle" name="RSS_10" border="0" /></a> </div> <div align="center"> <a href="index2.php?option=com_rss&feed=RSS2.0&no_html=1"> <img src="http://localhost/landed.at/images/M_images/rss20.gif" alt="RSS 2.0" align="middle" name="RSS_20" border="0" /></a> </div> <div align="center"> <a href="index2.php?option=com_rss&feed=ATOM0.3&no_html=1"> <img src="http://localhost/landed.at/images/M_images/atom03.gif" alt="ATOM 0.3" align="middle" name="ATOM_03" border="0" /></a> </div> <div align="center"> <a href="index2.php?option=com_rss&feed=OPML&no_html=1"> <img src="http://localhost/landed.at/images/M_images/opml.png" alt="OPML" align="middle" name="OPML" border="0" /></a> </div> </div></td> </tr></table> </td></tr> </table> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-543330-4"; urchinTracker(); </script></body> </html><!-- 1190732220 -->
  8. the following code sel works in i.e but not firefox. if(response!="" || response != false) { alert("ok here rsponse = "+response); // UPDATE select box sel2 content sel = document.cities.sel2; alert("ok here sel = "+sel); sel.options[0] = new Option("me","too"); document.getElementById("ajaxTest").innerHTML ="response"; } any thoughts ? thanks
  9. Were having trouble reading the xml tree inside php, in the documentation it should have been posted and with sendAndLoad vars the key is the corresponding object name in flash. So for the flash xml we have.. xmlOUT.sendAndLoad(this.path, xmlRTN); but in php echo $_POST['xmlOUT']; doesnt work. were pulling our hair out. SO any help is greatly appreciated.
  10. Thanks it looks like its working, I couldnt think it was as easy as that, implode looks pretty darn powerful.
  11. I have this zip file script which seemed to do what I wanted I will paste that in a second. But I discovered that the files it adds are not copied files, that is what I want to do. It seems I can copy for example graph.swf, but it creating an empty file and just adding the extension. I wanted to copy an actual file. Is the following modifyable to do this ? I have good integration experience with php but I wouldnt say a lot more than that. I use the class zip as follows the red text is where i try and copy a file into the zip. <? $theName=$_POST['rloName']; require("zip.php"); $zipfile = new zipfile(); // add the subdirectory ... important! $zipfile -> add_dir("$theName/"); $zipfile -> add_dir("$theName/data/"); // add the binary data stored in the string 'filedata' $filedata = "(read your file into $filedata)"; $zipfile -> add_file($filedata, "$theName/graph.swf"); // the next three lines force an immediate download of the zip file: //header("Content-type: application/octet-stream"); //header("Content-disposition: attachment; filename=test.zip"); //echo $zipfile -> file(); // OR instead of doing that, you can write out the file to the loca disk like this: $filename = "output.zip"; $fd = fopen ($filename, "wb"); $out = fwrite ($fd, $zipfile -> file()); fclose ($fd); ?> <?php /* Zip file creation class makes zip files on the fly... use the functions add_dir() and add_file() to build the zip file; see example code below by Eric Mueller http://www.themepark.com v1.1 9-20-01 - added comments to example v1.0 2-5-01 initial version with: - class appearance - add_file() and file() methods - gzcompress() output hacking by Denis O.Philippov, webmaster@atlant.ru, http://www.atlant.ru */ // official ZIP file format: http://www.pkware.com/appnote.txt class zipfile { var $datasec = array(); // array to store compressed data var $ctrl_dir = array(); // central directory var $eof_ctrl_dir = "\x50\x4b\x05\x06\x00\x00\x00\x00"; //end of Central directory record var $old_offset = 0; function add_dir($name) // adds "directory" to archive - do this before putting any files in directory! // $name - name of directory... like this: "path/" // ...then you can add files using add_file with names like "path/file.txt" { $name = str_replace("\\", "/", $name); $fr = "\x50\x4b\x03\x04"; $fr .= "\x0a\x00"; // ver needed to extract $fr .= "\x00\x00"; // gen purpose bit flag $fr .= "\x00\x00"; // compression method $fr .= "\x00\x00\x00\x00"; // last mod time and date $fr .= pack("V",0); // crc32 $fr .= pack("V",0); //compressed filesize $fr .= pack("V",0); //uncompressed filesize $fr .= pack("v", strlen($name) ); //length of pathname $fr .= pack("v", 0 ); //extra field length $fr .= $name; // end of "local file header" segment // no "file data" segment for path // "data descriptor" segment (optional but necessary if archive is not served as file) $fr .= pack("V",$crc); //crc32 $fr .= pack("V",$c_len); //compressed filesize $fr .= pack("V",$unc_len); //uncompressed filesize // add this entry to array $this -> datasec[] = $fr; $new_offset = strlen(implode("", $this->datasec)); // ext. file attributes mirrors MS-DOS directory attr byte, detailed // at http://support.microsoft.com/support/kb/articles/Q125/0/19.asp // now add to central record $cdrec = "\x50\x4b\x01\x02"; $cdrec .="\x00\x00"; // version made by $cdrec .="\x0a\x00"; // version needed to extract $cdrec .="\x00\x00"; // gen purpose bit flag $cdrec .="\x00\x00"; // compression method $cdrec .="\x00\x00\x00\x00"; // last mod time & date $cdrec .= pack("V",0); // crc32 $cdrec .= pack("V",0); //compressed filesize $cdrec .= pack("V",0); //uncompressed filesize $cdrec .= pack("v", strlen($name) ); //length of filename $cdrec .= pack("v", 0 ); //extra field length $cdrec .= pack("v", 0 ); //file comment length $cdrec .= pack("v", 0 ); //disk number start $cdrec .= pack("v", 0 ); //internal file attributes $ext = "\x00\x00\x10\x00"; $ext = "\xff\xff\xff\xff"; $cdrec .= pack("V", 16 ); //external file attributes - 'directory' bit set $cdrec .= pack("V", $this -> old_offset ); //relative offset of local header $this -> old_offset = $new_offset; $cdrec .= $name; // optional extra field, file comment goes here // save to array $this -> ctrl_dir[] = $cdrec; } function add_file($data, $name) // adds "file" to archive // $data - file contents // $name - name of file in archive. Add path if your want { $name = str_replace("\\", "/", $name); //$name = str_replace("\\", "\\\\", $name); $fr = "\x50\x4b\x03\x04"; $fr .= "\x14\x00"; // ver needed to extract $fr .= "\x00\x00"; // gen purpose bit flag $fr .= "\x08\x00"; // compression method $fr .= "\x00\x00\x00\x00"; // last mod time and date $unc_len = strlen($data); $crc = crc32($data); $zdata = gzcompress($data); $zdata = substr( substr($zdata, 0, strlen($zdata) - 4), 2); // fix crc bug $c_len = strlen($zdata); $fr .= pack("V",$crc); // crc32 $fr .= pack("V",$c_len); //compressed filesize $fr .= pack("V",$unc_len); //uncompressed filesize $fr .= pack("v", strlen($name) ); //length of filename $fr .= pack("v", 0 ); //extra field length $fr .= $name; // end of "local file header" segment // "file data" segment $fr .= $zdata; // "data descriptor" segment (optional but necessary if archive is not served as file) $fr .= pack("V",$crc); //crc32 $fr .= pack("V",$c_len); //compressed filesize $fr .= pack("V",$unc_len); //uncompressed filesize // add this entry to array $this -> datasec[] = $fr; $new_offset = strlen(implode("", $this->datasec)); // now add to central directory record $cdrec = "\x50\x4b\x01\x02"; $cdrec .="\x00\x00"; // version made by $cdrec .="\x14\x00"; // version needed to extract $cdrec .="\x00\x00"; // gen purpose bit flag $cdrec .="\x08\x00"; // compression method $cdrec .="\x00\x00\x00\x00"; // last mod time & date $cdrec .= pack("V",$crc); // crc32 $cdrec .= pack("V",$c_len); //compressed filesize $cdrec .= pack("V",$unc_len); //uncompressed filesize $cdrec .= pack("v", strlen($name) ); //length of filename $cdrec .= pack("v", 0 ); //extra field length $cdrec .= pack("v", 0 ); //file comment length $cdrec .= pack("v", 0 ); //disk number start $cdrec .= pack("v", 0 ); //internal file attributes $cdrec .= pack("V", 32 ); //external file attributes - 'archive' bit set $cdrec .= pack("V", $this -> old_offset ); //relative offset of local header // echo "old offset is ".$this->old_offset.", new offset is $new_offset<br>"; $this -> old_offset = $new_offset; $cdrec .= $name; // optional extra field, file comment goes here // save to central directory $this -> ctrl_dir[] = $cdrec; } function file() { // dump out file $data = implode("", $this -> datasec); $ctrldir = implode("", $this -> ctrl_dir); return $data. $ctrldir. $this -> eof_ctrl_dir. pack("v", sizeof($this -> ctrl_dir)). // total # of entries "on this disk" pack("v", sizeof($this -> ctrl_dir)). // total # of entries overall pack("V", strlen($ctrldir)). // size of central dir pack("V", strlen($data)). // offset to start of central dir "\x00\x00"; // .zip file comment length } } ?> thanks for any ideas on this one.
  12. I think you have to include the file zip.php for it to be available. Im going to test your script as im doing something similar. Yes it works add this to any script you need to access this class. require("zip.php");
  13. seems the full directory path works more reliably, when I thought code either worked or didnt! so where I had simply $file $dir.$file gives me the correct answer. thanks and welcome any more interest.
  14. inside admin directory is a folder called "hh" and a file callled admin.php both are being seen by the script below but "hh" is not being recognised as a folder with is_dir comming out as false ??? $dir="./admin/"; openFolder(); function openFolder () { clearstatcache() ; global $dir; if (is_dir($dir)) { //open catalog $open = opendir($dir); //check every file while (false !== ($file = readdir($open))) { var_dump (is_dir($file)); echo $file; } } }
  15. I have a problem in that afolder i created inside a folder by dreamweaver is being seen as a file and not a directory, I dont know if that has anything to do with your problem, but have a look to see if it is seeing the tpye correctly.
  16. ahhh, that seems simpler glob looked like a custom function. Thanks I will use that.
  17. I didnt understand it or how to use it, i can appreciate its simplicity and wildcard but what is glob ? I do thank you for your neat coding, i'm a flash guy normally so struggle with all this php. thanks
  18. I get the  [font=Verdana]unexpected T_GLOBAL[/font] when using    inside function [   global $allowTypes ] something not set up right in my config ?
  19. That last bit of code is working well except for scope, I cant read $allowTypes=array("xml","txt"); which I have set outside the function. I think I need to modify some php.ini values to read it, or declare it global ?
  20. I want to list only xml files in a folder, so far I have the directory showing all files..[code] $file_dir="test"; $dir=opendir($file_dir); while ($file=readdir($dir)) { if ($file != "." && $file != "..") { echo "<a href=".$file_dir."/".$file." target=_blank>".$file."</a>"; echo "<br>"; } } [/code] what is the following line doing ? [font=Verdana]if ($file != "." && $file != "..")[/font] How can I read the extension, do I have to manually do the string operation of looking for the last "." thanks
  21. But can I take the htaccess login data and create a session from that, so I can always know WHO is authenticated?
  22. I try to create a password file for basic authentication, and apache tells me I can run the password utility file in bin directory. But the window closes almost immediately. I try to run command from windows cmd but it doesnt recognise the command. Would appreciate a prod in the right direction. thanks ???
  23. Hi guys I would like not to use a database for this simple application but would still like to be able to autheticate and identify users of which there will only ever be a handful hence why I feel .htaccess and its .htpassword files could work. [size=14pt]1. Why cant browsers see the passwords stored in .htpassword though ? [/size] Also how can I get php to set a session with this user info and then allow that person to see only their files. The files being xml creations by the said people. [size=14pt]2 Is that possible ? can I set some kind of attribute to a file to identify the owner. I simply want to stop users editing other peoples files.[/size] I am building xml files which drive a flash front end. The xml files will be created and edited with this very system. I don't want to use a database. I would prefer to show all the files if its not possible to mask the files to those of the owners/creators.
  24. Thanks for that informative reply, I feel I can use a file only system with confidence now. I will take a look at sqlite as well, thanks
  25. Do i need a database ? Hi this is a question about best practise I guess. I would like to know if I can take a form and provided it checks the data I would like to produce an XML file straight away. I want to skip the database step. Are there any things wrong with this method. The xml is going to be used to populate a flash front end and it doesnt care how the xml is created it just needs to be strict format / correct Have you done this ? I have always used a db myself.
  • 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.