Jump to content

rhodesa

Staff Alumni
  • Posts

    5,253
  • Joined

  • Last visited

Everything posted by rhodesa

  1. Can you elaborate more on the context of how this will be used? Are you thinking of using cURL to get the contents of a webpage and then parsing the HTML for this?
  2. By having separate pages, you do have a speed increase, since there wouldn't be any scripts running...but you can solve that with some proper caching mechanisms. The advantage of using templates is that if you want to make a change to something on the template (aka something that is on every page) you only have to change it in one place...and with 65 pages, that will save you HOURS of sanity. I would look into a pre-existing CMS system. A lot of people use Joomla and Drupal...I personally prefer cmsMadeSimple. All of them should allow you to have a template (or even a couple different ones)
  3. http://jqueryui.com/demos/datepicker/
  4. Are you trying to replace <{page}> with the name of the class? As of right now, you are trying to replace it with an object, which can't just arbitrarily happen.
  5. what does your code look like so far? you will want to do something like this: <?php $fh = fopen('file.txt','w+'); while(...code for loop here...){ $row = array(); //Build an array of data fwrite($fh,implode("\t",$row).PHP_EOL); } fclose($fh); ?>
  6. oh...well that is for Atom/RSS/KML feeds...this is just XML. feeds need to be in a specific format. if you use a generic XML validator like: http://validator.w3.org/
  7. The main part of the XML outputted by the PHP is good: <?xml version="1.0"?> <content><gallery><image>/home/.../.../Photography/Bug.jpg</image><image>/home/.../.../Photography/Cardinal baby2.jpg</image><image>/home/.../.../Photography/Cicada.jpg</image><image>/home/.../.../Photography/Clematis4.jpg</image><image>/home/.../.../Photography/DSCN0561.jpg</image><image>/home/.../.../Photography/Dogwood red berry.jpg</image><image>/home/.../.../Photography/Fern with sun stripe (2).jpg</image><image>/home/.../.../Photography/Ferns in Rows (3).jpg</image><image>/home/.../.../Photography/Frog.jpg</image><image>/home/.../.../Photography/Gladiolus interior 4 (2).jpg</image><image>/home/.../.../Photography/Hosta Flowers 3.jpg</image><image>/home/.../.../Photography/Hummingbird 6 (5).jpg</image><image>/home/.../.../Photography/Hummingbird 7 (2).jpg</image><image>/home/.../.../Photography/Jap Maple with dew.jpg</image><image>/home/.../.../Photography/Peony Blossom2 (3).jpg</image><image>/home/.../.../Photography/Vinca.jpg</image><image>/home/.../.../Photography/bee on cone flower (3).jpg</image><image>/home/.../.../Photography/birch leaves.jpg</image><image>/home/.../.../Photography/bumble best 2 (2).jpg</image><image>/home/.../.../Photography/clematis1 (2).jpg</image><image>/home/.../.../Photography/dogwood blossom2 (2).jpg</image><image>/home/.../.../Photography/evergreen new growth (2).jpg</image><image>/home/.../.../Photography/hosta interior (3).jpg</image><image>/home/.../.../Photography/yellow maple leaf on evergreen (2).jpg</image></gallery></content> but this stuff after shouldn't be there: <!-- www.000webhost.com Analytics Code --> <script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script> <noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript> <!-- End Of Analytics Code --> any idea where that is coming from? edit: p.s. - once we get this to valid XML...we'll have to work on getting those paths to the Photography folder correct. Right now they are the filesystem path, but you probably want the url path (easy fix)
  8. then i would turn each element into an associate array to accomplish the same idea. So your array would turn into something like this: $usable => Array (3) ( ['8'] = Array ( ) ( ['type'] = String(4) "news" ['color'] = String(3) "red" ['title'] = String(18) "Something Happened" ) ['17'] = Array ( ) ( ['type'] = String(4) "post" ['color'] = String(4) "blue" ['title'] = String(13) "Some New Post" ) ['13'] = Array ( ) ( ['type'] = String(4) "news" ['color'] = String(3) "red" ['title'] = String(23) "Something Else Happened" ) )
  9. this works fine for me too <?php print_r($_GET); ?> <form action="" method="GET"> <select name="Interests[]" multiple="multiple" size="10"> <option value=".NET Using C#">.NETUsing C#</option> </select> <input type="submit" /> </form>
  10. SELECT signuphotel.email FROM proposal LEFT JOIN signuphotel ON proposal.county = signuphotel.county AND proposal.starrating = signuphotel.starrating WHERE proposal.county = '$county' AND proposal.starrating = '$starrating' ORDER BY proposal.starrating DESC LIMIT 1
  11. How are you printing it on the thankyou page? This works fine for me: <?php print_r($_POST); ?> <form action="" method="POST"> <select name="Interests[]" multiple="multiple" size="10"> <option value=".NET Using C#">.NETUsing C#</option> </select> <input type="submit" /> </form>
  12. I would create Classes...so have a separate class for each type of item. Then you can have methods (or attributes) that return different info. For example, in your classes you can have a getColor() method that returns the bgcolor for that type of event. This allows you to easily add more types of events later on too.
  13. If you echo the values as INPUT values...as it seems you do....then those values should be available via POST on my_cart.php when the form is posted there. On the page with the form and the default values, if you do a View Source, what does the HTML for the form look like? Is there any info missing? Wrong input names?
  14. why are you printing a table before it? this line: echo $xml->asXML(); should be the only output on the page. can you post the ENTIRE code...instead of just this snippet
  15. Probably in a logical manor ...this is a VERY vague question...can you describe in more detail what you are trying to ask
  16. rhodesa

    Cron Job

    http://www.manpagez.com/man/5/crontab/
  17. off the top of my head, i'm not sure if foreach will process them or not...but (if it's a numerically indexed array) you can always do: for($n=0;$n < count($arr);$n++){ }
  18. ok...try this: <?php $dir = '../Photography/'; $file_ext = ".jpg"; if(!is_dir($dir)) die("Dir doesn't exist"); $files = glob($dir.'*'.$file_ext); if(!is_array($files) || !count($files)) die("No files found in dir"); $xml = new SimpleXMLElement('<content />'); $gallery = $xml->addChild('gallery'); foreach($files as $file){ $gallery->addChild('image',$file); } file_put_contents($dir.'images.xml',$xml->asXML()); header("Content-type: text/xml;"); echo $xml->asXML(); ?>
  19. ...added closing parenthesis doh...the simple solution is usually the best
  20. You need to put the code in a PHP file and run it on a webserver that has PHP on it edit: try changing the file to index.php and see if that works
  21. hum...how about this: <?php session_start(); $software_title="Impatica"; $date= date("y-m-d"); $time= date("H:i:s"); if (isset($_SESSION['fullname'])) { // record activity in db include("inc/insertrecord.php"); //Location of file, must be out of web root $file_location='impatica.exe'; //supply the right file format header('Content-type: application/exe'); header('Expires: 0'); header('Pragma: public'); //force browser to prompt to download file //cool option of this header is that allows you to rename the file header('Content-Disposition: attachment; filename="impatica.exe"'); //open file $file=fopen($file_location,'r'); while(!feof($file) && $cur<$end) { print fread($file,min(1024*16,$end-$cur)); $cur+=1024*16; } //close the file fclose($file); } else { header("Location: https://web"); } exit; ?>
×
×
  • 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.