Jump to content

QuickOldCar

Staff Alumni
  • Posts

    2,972
  • Joined

  • Last visited

  • Days Won

    28

Everything posted by QuickOldCar

  1. This would be achieved by using GET in a form or simply assigning a variable to a GET value from the address bar url. With or without a form does not matter. Try changing the value in just the url to see. A simple example: <?php $id = mysql_real_escape_string($_GET['id']); ?> <form name="input" action="" method="get"> ID: <input type="text" name="id" value="<?php echo $id;?>"/> <input type="submit" value="Submit" /> </form> <?php if(!isset($_GET['id']) OR $id == "") { echo "Please insert a value"; } else { echo "The id is $id <br />"; } ?> For some tutorials on forms along with GET,POST and so on. http://www.w3schools.com/html/html_forms.asp http://www.tizag.com/phpT/postget.php
  2. OK, I finally got some time to get this working. It will find the subdomain of a url, if no subdomain is present the subdomain will be www. I have the common levels for domain patterns for the preg_match, if I missed any or need more, add them in. <?php //getting url from address bar //http://mysite.com/this-script-name.php?url=subdomain.domain.co.uk $url = mysql_real_escape_string($_GET['url']); function getsubdomain($new_parse_url) { //if empty value display www and exit if($new_parse_url == ""){ return "www"; EXIT; } //add http:// if is not present if (substr($new_parse_url, 0, 5) != "http:") { $new_parse_url = "http://$new_parse_url"; } //parse and clean the url $parsedUrl = parse_url(strtolower(trim($new_parse_url))); $parse_url = $parsedUrl[host] ? $parsedUrl[host] : array_shift(explode('/', $parsedUrl[path], 2)); //patterns for preg_match of second level domains $slds = '\.co\.uk|\.me\.uk|\.net\.uk|\.org\.uk|\.sch\.uk| \.ac\.uk|\.gov\.uk|\.nhs\.uk|\.police\.uk| \.mod\.uk|\.asn\.au|\.com\.au|\.net\.au|\.id\.au| \.org\.au|\.edu\.au|\.gov\.au|\.csiro\.au'; //sorting to just get domain preg_match ( "/^(http:\/\/|https:\/\/|)[a-zA-Z-]([^\/]+)/i", $parse_url, $thematches ); //host position $host = $thematches[2]; //explode the parsed url into parts $explode_parse = explode(".",$parse_url); //subdomain is position zero $subdomain = $explode_parse[0]; //count the parts $count_positions = count($explode_parse); //check if second level domain exists if (preg_match("/$slds$/", $host, $thematches)) { preg_match ( "/[^\.\/]+\.[^\.\/]+\.[^\.\/]+$/", $host, $thematches ); //counting positions so host is not used as subdomain if($count_positions <= 3){ $subdomain = "www"; } } else { //if second level domain does not exist preg_match ( "/[^\.\/]+\.[^\.\/]+$/", $host, $thematches ); //counting positions so host is not used as subdomain if($count_positions <= 2){ $subdomain = "www"; } } //return the subdomain return $subdomain; } //usage $subdomain = getsubdomain($url); echo $subdomain; ?>
  3. I believe etrader wants to read from different urls and find the subdomains only. The problem arises when there is no www, and also no subdomain value, it would read the subdomain as being the first part of a domain name. I don't believe what I did over complicates it at all, because it's kind of a difficult task to accomplish. It can't just be simple explodes because the amounts and the values of the positions may change. I believe is just one more step needed in the code I made, to check for a match if the first part domain name comes up as the subdomain, then just call it www as the subdomain instead. I'll fiddle with in in a little bit and get it working.
  4. Well if is no subdomain I'm getting the first part of the host domain, is something that still needs work. Maybe just exploding them, counting the positions up until the main host may work. No time to work on this until day after tomorrow.
  5. This is not an easy task to do, but I sat here and figured out a way because it interests me. I first parse the url, then find the main host, compared the values, I insert a www. to the front of the main host so there is always a position zero in the array. Then exploded the array and use position zero as the subdomain. Basically if there is no subdomain it will always be www. , because www. is actually a subdomain. <?php $url = mysql_real_escape_string($_GET['url']); if (substr($url, 0, 5) != "http:") { $url = "http://$url"; } function getsubdomain($new_parse_url) { $parsedUrl = parse_url(strtolower($new_parse_url)); $parse_url = trim($parsedUrl[host] ? $parsedUrl[host] : array_shift(explode('/', $parsedUrl[path], 2))); $slds = '\.co\.uk|\.me\.uk|\.net\.uk|\.org\.uk|\.sch\.uk| \.ac\.uk|\.gov\.uk|\.nhs\.uk|\.police\.uk| \.mod\.uk|\.asn\.au|\.com\.au|\.net\.au|\.id\.au| \.org\.au|\.edu\.au|\.gov\.au|\.csiro\.au'; preg_match ( "/^(http:\/\/|https:\/\/|)[a-zA-Z-]([^\/]+)/i", $parse_url, $thematches ); $host = $thematches[2]; if (preg_match("/$slds$/", $host, $thematches)) { preg_match ( "/[^\.\/]+\.[^\.\/]+\.[^\.\/]+$/", $host, $thematches ); } else { preg_match ( "/[^\.\/]+\.[^\.\/]+$/", $host, $thematches ); } if($parse_url == $thematches[0]){ $urlParts = "www.$thematches[0]"; } else { if (substr($parse_url, 0, 4) != "www.") { $parse_url = "www.$parse_url"; } $urlParts = $parse_url; } $subParts = explode('.', $urlParts); $subdomain = $subParts[0]; return $subdomain; } $subdomain = getsubdomain($url); echo $subdomain; ?>
  6. Look in /usr/bin It's been a while since I used centos you can make yourself a phpinfo file to see the locations place this code into a php file and name it like myinfo.php , then visit http://mysite.com/myinfo.php to see the locations. Use your server name of course. <?php phpinfo(); ?>
  7. This may also be able to read it. http://www.mozilla.org/projects/calendar/
  8. .ics is Apple's iCalendar Applications that can open an ics file: CopyControl Image Cytometry Inovate 3D CAD File IronCAD 3D CAD File Outlook (Calendar File) by Microsoft Corporation SwiftView (ICS Command File) Also...this is a php coding help forum which that had nothing to do about.
  9. Well I'll try to explain. It more so that your link in the href is lacking the http:// lets say you use this as a self to server url, or a server path <a href="./">link</a> <a href="../">link</a> <a href="/">link</a> now lets point it to a place on your site, nothing is needed besides a file or script name (this is the same way your domain names were treated) <a href="my-script.php">link</a> or <a href="gallery/">link</a> now when it sees a protocol such as http:// , ftp:// and so on, it knows to go outbound <a href="http://somesite.com">link</a>
  10. Change to use this line, it'll add the extra return. file_put_contents($file, implode($matches[1], "\n")."\n", FILE_APPEND); May I ask in what way these id's will be used? I'm curious.
  11. This is the correct way date.timezone = America/New_York And the results in phpinfo should read as this date date/time support enabled "Olson" Timezone Database Version 2008.2 Timezone Database internal Default timezone America/New_York Directive Local Value Master Value date.default_latitude 31.7667 31.7667 date.default_longitude 35.2333 35.2333 date.sunrise_zenith 90.583333 90.583333 date.sunset_zenith 90.583333 90.583333 date.timezone America/New_York America/New_York
  12. This can do what you need, follow the instructions and is lots of info there you can read if want to. http://phpthumb.sourceforge.net/
  13. Try this, it's most likely because there is no http:// up front. $web=mysql_result($result,$i,"web"); if (substr($web, 0, 5) != "http:") { $web = "http://$web"; }
  14. Even though the poster before beat me, I added sorting and removed duplicates to this as well. Pretty neat script, you just place a keyword after the scripts name in the url like: http://mysite.com/this-script-name.php?games <?php function text_between($start,$end,$string) { if ($start != '') {$temp = explode($start,$string,2);} else {$temp = array('',$string);} $temp = explode($end,$temp[1],2); return $temp[0]; } function gsscrape($keyword) { $keyword=str_replace(" ","+",$keyword); global $kw; $data=file_get_contents('http://clients1.google.com/complete/search?hl=en&q='.$keyword); $data=explode('[',$data,3); $data=explode('],[',$data[2]); foreach($data as $temp) { $kw[]= text_between('"','"',$temp); } } #simple to use, just use yourscriptname.php?keywords if ($_SERVER['QUERY_STRING']!='') { gsscrape($_SERVER['QUERY_STRING']); foreach ($kw as $keyword) { gsscrape($keyword); } //sorted and duplicates removed sort(array_unique($kw)); #all results echoed with break foreach ($kw as $keywords) { echo $keywords. "<br />"; } } ?>
  15. In addition to PFMaBiSmAd's great advice, you can just trim the www. off before it as well $domain_trim = ltrim($_SERVER['HTTP_HOST'], "www."); if ($_SERVER['HTTP_HOST'] != $domain_trim) { echo "some text here"; }
  16. Besides the tutorial here at phpfreaks on pagination. http://www.phpfreaks.com/tutorial/basic-pagination You may also look at my 2 demo examples of how I do my pagination. The codes are at the link locations. http://get.blogdns.com/paginate/ simple navigation of first,previous,show current,next,last any amount of results per page can be set pulls the current url along with any queries trims the page number and replaces it http://get.blogdns.com/dynaindex/paginate.php deluxe navigation hard set to 10 results per page pulls the current url along with any queries trims the page number and replaces it capable of jumping ahead groups of pages or setting a desired page and go directly there I use this code at my dynaindex doing multiple mysql select statements and optional GET parameters I have the mysql commented out so I can show the demo, uncomment and use your own values, comment out the example $total_posts variable. As for your script, I don't really like the way it works. As you have to manually insert the GET values which may change or add more at a later date, then if there is a GET value, the ? must be moved to before those values and ?pn=2 becomes &pn=2. (although you can check the GET values with isset and assign them where they need to go, or if empty have the variable empty) I think it would be wiser to just fetch the entire url along with the queries, and trim the page number...then insert your new desired page number.
  17. If you visit this link which shows the correct pagination results, you will see that you didn't include the GET parameters for category and subcategory in your links. http://www.hopefloatsdesign.co.za/shopping/list.php?category=clothing&subcategory=hats&pn=2
  18. I'm sorry, use this one instead. I added the action to only insert into the database if the post was submitted. <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <?php $host = 'localhost'; $usr = "VinnyG"; $password = 'thepassword'; $db_name = 'sitename'; $username = $_POST['username']; $height_above = $_POST['height_above']; $mb_diff = $_POST['mb_diff']; $alternative = $_POST['alternative']; $ppr = $_POST['ppr']; $general_location = $_POST['general_location']; $location_grid = $_POST['location_grid']; $runway_numbers = $_POST['runway_numbers']; $circuit_direction = $_POST['circuit_direction']; $circuit_height = $_POST['circuit_height']; $runway_length = $_POST['runway_length']; $surface = $_POST['surface']; $food = $_POST['food']; $radio_frequency = $_POST['radio_frequency']; $radio_callsign = $_POST['radio_callsign']; $radio_type = $_POST['radio_type']; $other_radio = $_POST['other_radio']; $fuel = $_POST['fuel']; $landing_fee = $_POST['landing_fee']; $operating_hours = $_POST['operating_hours']; $maintenance = $_POST['maintenance']; $hangarage = $_POST['hangarage']; $parking = $_POST['parking']; $accommodation = $_POST['accommodation']; $school = $_POST['school']; $remarks = $_POST['remarks']; $warnings = $_POST['warnings']; $weblinks = $_POST['weblinks']; $operator = $_POST['operator']; $google_image = $_POST['google_image']; if(isset($_POST['submit'])) { //connect to database mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ('Error Selecting DB:<br>'.mysql_error()); $insert_query = "INSERT INTO users (username, height_above, mb_diff, alternative, ppr, general_location, location_grid, runway_numbers, circuit_direction, circuit_height, runway_length, surface, food, radio_frequency, radio_callsign, radio_type, other_radio, fuel, landing_fee, operating_hours, maintenance, hangarage, parking, accommodation, school, remarks, warnings, weblinks, operator, google_image) VALUES ('$username', '$height_above', '$mb_diff', '$alternative', '$ppr', '$general_location', '$location_grid', '$runway_numbers', '$circuit_direction', '$circuit_height', '$runway_length', '$surface', '$food', '$radio_frequency', '$radio_callsign', '$radio_type', '$other_radio', '$fuel', '$landing_fee', '$operating_hours', '$maintenance', '$hangarage', '$parking', '$accommodation' , '$school', '$remarks', '$warnings', '$weblinks', '$operator', '$google_image')"; $insert_action = mysql_query($insert_query) or die ('Error During Insert :<br>'.mysql_error().'<br><br>Error occured running the following code :<br>'.$insert_query); echo "Your data has been saved"; } ?> <form name = "form1" method ="post" action=""> <table width="700" border="0" cellspacing="5" cellpadding="5" bgcolor = "#c9e1d0"> <caption> Submit Your Airfield Details </caption> <tr> <td width = "50"> </td> <td width = "240"> </td> <td width = "250"> </td> <td width = "160"><b>Example Input</b></td> </tr> <tr> <td> </td> <td>Airfield Name</td> <td><input type='text' name='username' size = '40' maxlength='30'></td> <td>Ince Blundell</td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above' size = '40' maxlength= '30'></td> <td>65 Ft</td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff' size = '40' maxlength='40'></td> <td>2 Mb</td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' size = '40' maxlength='30'></td> <td>Sherburn</td> </tr> <tr> <td> </td> <td>PPR?</td> <td><select name = "ppr"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td>Yes</td> </tr> <tr> <td> </td> <td>General Location</td> <td><input type='text' name='general_location' size = '40' maxlength='50' /></td> <td>3 Nm North Luton</td> </tr> <tr> <td> </td> <td>Location Grid Reference</td> <td><textarea name= "location_grid" input type = 'text' rows = "2" cols = "29" /></textarea></td> <td> 53°57'7.68"N<br /> 1°10'30.33"W</td> </tr> <tr> <td> </td> <td>Runway Numbers</td> <td><textarea name= "runway_numbers" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td><p>This format please<br /> 05-23<br /> 18-36<br /> 14-22 </p></td> </tr> <tr> <td> </td> <td>Circuit Direction</td> <td><textarea name= "circuit_direction" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td><p>05-LH<br /> 23-RH<br /> 14-LH </p></td> </tr> <tr> <td> </td> <td>Circuit Height</td> <td><input type='text' name='circuit_height' size = '40' maxlength='50' /></td> <td>1000 Ft</td> </tr> <tr> <td> </td> <td>Runway Length</td> <td><input type='text' name='runway_length' size = '40'maxlength='50' /></td> <td>500m</td> </tr> <tr> <td> </td> <td>Runway Surface</td> <td><select name = "surface"> <option value = "Grass">Grass</option> <option value="Tarmac">Tarmac</option> <option value ="Concrete">Concrete</option> <option value = "Dirt">Dirt</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Food?</td> <td><select name = "food"> <option value = "Cafe">Cafe</option> <option value="None">None</option> <option value ="Tea and Coffee">Tea and Coffee</option> <option value = "Make Your Own">Make Your Own</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Radio Frequency</td> <td><input type='text' name='radio_frequency' size = '40'maxlength='50' /></td> <td>135.475</td> </tr> <tr> <td> </td> <td>Radio Callsign</td> <td><input type='text' name='radio_callsign' size = '40'maxlength='50' /></td> <td>Rufforth Traffic</td> </tr> <tr> <td> </td> <td>Radio Type</td> <td><select name = "radio_type"> <option value = "Sefety Com">Safety Com</option> <option value="Air Ground">Air Ground</option> <option value ="Approach">Approach</option> <option value = "Tower">Tower</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Other Radio</td> <td><input type='text' name='other_radio' size = '40' maxlength='50' /></td> <td>E.G. if close to MATZ etc</td> </tr> <tr> <td> </td> <td>Fuel</td> <td><select name = "fuel"> <option value = "AvGas">AvGas</option> <option value="MoGas">MoGas</option> <option value ="AvGas and MoGas">AvGas and MoGas</option> <option value = "We will sort you some">We will sort you some</option> <option value = "None">None</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Landing Fee</td> <td><input type='text' name='landing_fee' size = '40' maxlength='50' /></td> <td> </td> </tr> <tr> <td> </td> <td>Operating Hours</td> <td><select name = "operating_hours"> <option value = "SR - SS">Sunrise - Sunset</option> <option value="See Remarks">Other - See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Maintenance?</td> <td><select name = "maintenance"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Hangarage?</td> <td><select name = "hangarage"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Parking?</td> <td><select name = "parking"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Accommodation?</td> <td><select name = "accommodation"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>School?</td> <td><select name = "school"> <option value = "Flexwing">Flexwing </option> <option value="3 Axis">3 Axis</option> <option value="All Microlight">All Mircolight</option> <option value="GA">GA</option> <option value="Gyro">Gyro</option> <option value="Other See Remarks">Other, See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Remarks:</td> <td><textarea name= "remarks" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Warnings:</td> <td><textarea name= "warnings" input="input" type = 'text' rows = "5" cols = "29" /></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Web Links</td> <td><textarea name= "weblinks" input="input" type = 'text' rows = "3" cols = "29" /></textarea></td> <td>Link to airfield website</td> </tr> <tr> <td> </td> <td>Operator Details</td> <td><textarea name= "operator" input="input" type = 'text' rows = "3" cols = "29" /></textarea></td> <td>As much info as possible</td> </tr> <tr> <td> </td> <td>Google Iframe Image</td> <td><textarea name= "google_image" input="input" type = 'text' rows = "5" cols = "29" /></textarea></td> <td>700 x 700 pixels please.</td> </tr> <tr> <td><input type='submit' name='submit' value='Have-It' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html>
  19. Here it is combined, I set the action= to nothing so it goes to the same page initially it came from. Hopefully this works, if not it probably has to do with running php code within joomla. <!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> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <?php if(isset($_POST)) { $host = 'localhost'; $usr = "VinnyG"; $password = 'thepassword'; $db_name = 'sitename'; $username = $_POST['username']; $height_above = $_POST['height_above']; $mb_diff = $_POST['mb_diff']; $alternative = $_POST['alternative']; $ppr = $_POST['ppr']; $general_location = $_POST['general_location']; $location_grid = $_POST['location_grid']; $runway_numbers = $_POST['runway_numbers']; $circuit_direction = $_POST['circuit_direction']; $circuit_height = $_POST['circuit_height']; $runway_length = $_POST['runway_length']; $surface = $_POST['surface']; $food = $_POST['food']; $radio_frequency = $_POST['radio_frequency']; $radio_callsign = $_POST['radio_callsign']; $radio_type = $_POST['radio_type']; $other_radio = $_POST['other_radio']; $fuel = $_POST['fuel']; $landing_fee = $_POST['landing_fee']; $operating_hours = $_POST['operating_hours']; $maintenance = $_POST['maintenance']; $hangarage = $_POST['hangarage']; $parking = $_POST['parking']; $accommodation = $_POST['accommodation']; $school = $_POST['school']; $remarks = $_POST['remarks']; $warnings = $_POST['warnings']; $weblinks = $_POST['weblinks']; $operator = $_POST['operator']; $google_image = $_POST['google_image']; //connect to database mysql_connect ("$host","$usr","$password") or die ('Error During Connect:<br>'.mysql_error()); mysql_select_db ("$db_name") or die ('Error Selecting DB:<br>'.mysql_error()); $insert_query = "INSERT INTO users (username, height_above, mb_diff, alternative, ppr, general_location, location_grid, runway_numbers, circuit_direction, circuit_height, runway_length, surface, food, radio_frequency, radio_callsign, radio_type, other_radio, fuel, landing_fee, operating_hours, maintenance, hangarage, parking, accommodation, school, remarks, warnings, weblinks, operator, google_image) VALUES ('$username', '$height_above', '$mb_diff', '$alternative', '$ppr', '$general_location', '$location_grid', '$runway_numbers', '$circuit_direction', '$circuit_height', '$runway_length', '$surface', '$food', '$radio_frequency', '$radio_callsign', '$radio_type', '$other_radio', '$fuel', '$landing_fee', '$operating_hours', '$maintenance', '$hangarage', '$parking', '$accommodation' , '$school', '$remarks', '$warnings', '$weblinks', '$operator', '$google_image')"; $insert_action = mysql_query($insert_query) or die ('Error During Insert :<br>'.mysql_error().'<br><br>Error occured running the following code :<br>'.$insert_query); } ?> <form name = "form1" method ="post" action=""> <table width="700" border="0" cellspacing="5" cellpadding="5" bgcolor = "#c9e1d0"> <caption> Submit Your Airfield Details </caption> <tr> <td width = "50"> </td> <td width = "240"> </td> <td width = "250"> </td> <td width = "160"><b>Example Input</b></td> </tr> <tr> <td> </td> <td>Airfield Name</td> <td><input type='text' name='username' size = '40' maxlength='30'></td> <td>Ince Blundell</td> </tr> <tr> <td> </td> <td>Height Above MSL</td> <td><input type='text' name='height_above' size = '40' maxlength= '30'></td> <td>65 Ft</td> </tr> <tr> <td> </td> <td>Mb Difference</td> <td><input type='text' name='mb_diff' size = '40' maxlength='40'></td> <td>2 Mb</td> </tr> <tr> <td> </td> <td>Alternative Airfield</td> <td><input type='text' name='alternative' size = '40' maxlength='30'></td> <td>Sherburn</td> </tr> <tr> <td> </td> <td>PPR?</td> <td><select name = "ppr"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td>Yes</td> </tr> <tr> <td> </td> <td>General Location</td> <td><input type='text' name='general_location' size = '40' maxlength='50' /></td> <td>3 Nm North Luton</td> </tr> <tr> <td> </td> <td>Location Grid Reference</td> <td><textarea name= "location_grid" input type = 'text' rows = "2" cols = "29" /></textarea></td> <td> 53°57'7.68"N<br /> 1°10'30.33"W</td> </tr> <tr> <td> </td> <td>Runway Numbers</td> <td><textarea name= "runway_numbers" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td><p>This format please<br /> 05-23<br /> 18-36<br /> 14-22 </p></td> </tr> <tr> <td> </td> <td>Circuit Direction</td> <td><textarea name= "circuit_direction" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td><p>05-LH<br /> 23-RH<br /> 14-LH </p></td> </tr> <tr> <td> </td> <td>Circuit Height</td> <td><input type='text' name='circuit_height' size = '40' maxlength='50' /></td> <td>1000 Ft</td> </tr> <tr> <td> </td> <td>Runway Length</td> <td><input type='text' name='runway_length' size = '40'maxlength='50' /></td> <td>500m</td> </tr> <tr> <td> </td> <td>Runway Surface</td> <td><select name = "surface"> <option value = "Grass">Grass</option> <option value="Tarmac">Tarmac</option> <option value ="Concrete">Concrete</option> <option value = "Dirt">Dirt</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Food?</td> <td><select name = "food"> <option value = "Cafe">Cafe</option> <option value="None">None</option> <option value ="Tea and Coffee">Tea and Coffee</option> <option value = "Make Your Own">Make Your Own</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Radio Frequency</td> <td><input type='text' name='radio_frequency' size = '40'maxlength='50' /></td> <td>135.475</td> </tr> <tr> <td> </td> <td>Radio Callsign</td> <td><input type='text' name='radio_callsign' size = '40'maxlength='50' /></td> <td>Rufforth Traffic</td> </tr> <tr> <td> </td> <td>Radio Type</td> <td><select name = "radio_type"> <option value = "Sefety Com">Safety Com</option> <option value="Air Ground">Air Ground</option> <option value ="Approach">Approach</option> <option value = "Tower">Tower</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Other Radio</td> <td><input type='text' name='other_radio' size = '40' maxlength='50' /></td> <td>E.G. if close to MATZ etc</td> </tr> <tr> <td> </td> <td>Fuel</td> <td><select name = "fuel"> <option value = "AvGas">AvGas</option> <option value="MoGas">MoGas</option> <option value ="AvGas and MoGas">AvGas and MoGas</option> <option value = "We will sort you some">We will sort you some</option> <option value = "None">None</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Landing Fee</td> <td><input type='text' name='landing_fee' size = '40' maxlength='50' /></td> <td> </td> </tr> <tr> <td> </td> <td>Operating Hours</td> <td><select name = "operating_hours"> <option value = "SR - SS">Sunrise - Sunset</option> <option value="See Remarks">Other - See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Maintenance?</td> <td><select name = "maintenance"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Hangarage?</td> <td><select name = "hangarage"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Parking?</td> <td><select name = "parking"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Accommodation?</td> <td><select name = "accommodation"> <option value = "Yes">Yes </option> <option value="No">No </option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>School?</td> <td><select name = "school"> <option value = "Flexwing">Flexwing </option> <option value="3 Axis">3 Axis</option> <option value="All Microlight">All Mircolight</option> <option value="GA">GA</option> <option value="Gyro">Gyro</option> <option value="Other See Remarks">Other, See Remarks</option> </select></td> <td> </td> </tr> <tr> <td> </td> <td>Remarks:</td> <td><textarea name= "remarks" input type = 'text' rows = "5" cols = "29" /></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Warnings:</td> <td><textarea name= "warnings" input="input" type = 'text' rows = "5" cols = "29" /></textarea></td> <td>As much info as possible 500 characters max</td> </tr> <tr> <td> </td> <td>Web Links</td> <td><textarea name= "weblinks" input="input" type = 'text' rows = "3" cols = "29" /></textarea></td> <td>Link to airfield website</td> </tr> <tr> <td> </td> <td>Operator Details</td> <td><textarea name= "operator" input="input" type = 'text' rows = "3" cols = "29" /></textarea></td> <td>As much info as possible</td> </tr> <tr> <td> </td> <td>Google Iframe Image</td> <td><textarea name= "google_image" input="input" type = 'text' rows = "5" cols = "29" /></textarea></td> <td>700 x 700 pixels please.</td> </tr> <tr> <td><input type='submit' name='submit' value='Have-It' /></td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html>
  20. try that out and see the results. the commented out version would overwrite the file <?php //read a file $my_file = "samplefile.txt"; if (file_exists($my_file)) { $data = file($my_file); $total = count($data); echo "<br />Total lines: $total<br />"; foreach ($data as $line) { $line = trim($line); echo "$line<br />"; } //add a new line to end $write = fopen($my_file, 'a+'); $message = "added a new line here\r\n"; fputs($write, $message); fclose($write); /* //note the w, this will overwrite the entire contents $write = fopen($my_file, 'w'); $message = "I just added this line and overwrote the file\r\n"; fputs($write, $message); fclose($write); */ } else { echo "No file to display"; } ?>
  21. Doing some wash here in my basement as I do some work on the computer. Dryer made a funny noise, then i smelled something burning, room filling with smoke. I ran to the dryer and flames were shooting out the door, the bottom, and even out the little cracks in the sides. These were wet clothes burning as I just placed them in not more than 5 minutes prior. It’s a 220 electric dryer. I went and hit the breaker, got buckets of water and doused the flames in and out. Then more smoke was there, so much I could barely see. While not standing directly in lots of water, I carefully unplugged the dryer from further use. Now it was time to clear the smoke from the house. Every window and door open. Fan directly at back door pointing out, one room upstairs a fan in each of the 2 windows pointing out. My basement bilco door wide open. All the while checking to make sure the fire was indeed out. So a few more buckets of water in it certainly couldn’t hurt. Here’s what happened, the something with the drum broke, clothes went down the bottom directly onto the element through the space of the drum and back wall. Is amazing that wet clothes can burn that way, but a lot of electricity can burn anything. Being a former Fire Systems Inspector I am very familiar in how to put out certain types of fires. I wrote this article to warn others the hazards of your dryer. This could happen to anyone at any time, I'm just glad I was sitting near it at the time. (Although not related to my fire) At this time I will also remind people to clean out all the lint from within their dryer and the vent hose, don't forget to unplug it or also turn off the gas if is a gas unit. Keep an eye on them and never leave them unattended for long.
  22. If still having issues and need a decent thumbnailer use this. http://phpthumb.sourceforge.net/ And here's a direct download link. http://downloads.sourceforge.net/project/phpthumb/phpThumb%28%29/1.7.9/phpThumb_1.7.9.zip?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fphpthumb%2Ffiles%2FphpThumb%2528%2529%2F&ts=1303233583&use_mirror=cdnetworks-us-1 I used to use it before I wrote my own.
  23. I forgot that file_get_contents needs http to work, so can add this to the top along with the get so can do links like http://mysite.com/thisscript.php?url=somesite.com It's also better to use curl to fully follow the paths and redirects $url = mysql_real_escape_string(trim($_GET['url'])); if(substr($url, 0, 5) != "http:") { $url = "http://$url"; }
  24. Here's what I made up for you. It would be extremely difficult to get a link that does not have a href attribute and also not containing the http or www. Something like truveo.com/category/news Do you explode the point?, then check for end slash?, explode slashes? it might not have a slash,end of news might be a ? . Anyway, it's not easy. Not every link is the same and if you make those rules it would exclude others, I suppose can do the code multiple times with each method and combine them all. For those you would have to strip_tags on the page, then end explode every word by . and see if it contains a pattern such as .com, .co.ok, .org and so on. And most likely lots of trimming. Even then I could see some flaws with the method. So here's a simple script to find any http https or www link that is not inside a href tag It's hard to find pages with links and no href, so i tested with my own domain generator with href to off <?php $url = "http://get.blogdns.com/dynaindex/generator.php?character=alphabet&length=9&amount=10&sort=random&protocol=www.&tldext=.co.uk&hyperlink=no"; $file_data = @file_get_contents($url); if ($file_data === false) { echo "<div align='center'><h2><FONT COLOR=red>Unable to retrieve any data</><h2></div>"; EXIT; } else { preg_match( '@<meta\s+http-equiv="Content-Type"\s+content="([\w/]+)(;\s+charset=([^\s"]+))?@i', $file_data, $matches ); if (isset($matches[1])) { $mime = $matches[1]; } if (isset($matches[3])) { $charset = $matches[3]; } $utf8_text = iconv( $charset, "utf-8", $file_data ); $utf8_text = preg_replace('#<script[^>]*>.*?</script>#is','',$utf8_text); $utf8_text = str_replace(array("`","!","@","#","$","^","* ","(",")","{","}",":",";","'","<p>","</p>","<br>","<br/>","<br />","<br/>","</a>","<ul>","</ul>","<li>","</li>","<head>","</head>","<div>","</div>","<form>","</form>","<body>","</body>"), ' ', $utf8_text); $keywords = explode(" ", $utf8_text); foreach ($keywords as $keyword) { if(substr($keyword, 0, 7) == "http://" || substr($keyword, 0, == "https://" || substr($keyword, 0, 4) == "www.") { echo trim($keyword)."<br />"; } } } ?>
×
×
  • 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.