Jump to content

Malcerous

Members
  • Posts

    9
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Malcerous's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What I would do and am somewhat doing right now with perl is. 1.) Write a PERL script or BASH script that will run TOPAS and pipe resuts to a file. The problem with TOPAS is kind of messy because every time it refreshes it will write a new section.(It will be very hard to parse) - I would find out what you want to identify and display: uptime, processes, diskspace, etc etc - Write a bash script that pipes the results to a file every minute and ftp/sftp the file to you webserver. Schedule using a cron job. - Write a php webpage that will parse the files from the server. - Everytime they refresh the page after 1 minute the status will be updated. This would be minimal on resources for all servers and pretty easy to do. You can even add javascript to the page to refresh every minute. I hope that this helps.
  2. Hello All: I am running APACHE, PHP and MYSQL on my laptop (VISTA). This is used for a development environment that I can take with me anywhere. My problem is that when I run my (ex: test.php) test.php ------------ <?php $welcome="Hello World"; echo $welcome; ?> My browser shows -------------------- Hello World The only problem is if I click on view source (Firefox 2) I will see the following. --------------------------------------------------------------------------- <?php $welcome="Hello World"; echo $welcome; ?> Hello World -------------------------------------------------- I am not sure if this is a PHP or APACHE setting but I am finding it hard to get an answer from a search engine.
  3. I have an apache server infront of a java application server. I am getting what is similar to a very small DOS attack. I am seeing alo of errors in my http_error_log [Tue Apr 10 hr:mm:ss yyyy] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/www/htdocs/default.asp [Tue Apr 10 hr:mm:ss yyyy] [error] [client xxx.xxx.xxx.xxx] File does not exist: /usr/www/htdocs/order.asp I do not support asp files on my server. The problem is that these requests are being passed to my application servers to see if the files exist. I am wondering if there is a way to block or redirect all requests for .asp and .cgi files using the httpd.conf file.
  4. This is not the best solution but it may work: Take take the maximum amount of characters that will fit in your space with a wrap, use a Capital M or W for your calculation. Now that you know the maximum amount of characters that will fit you can then truncate the length of text. The only thing that you will have to check for is carraige return / new lines and subtract the number of characters from the line. This is an ugly process and I have done this once before. You should always end up with Text that is smaller than the box. I hope this may steer you in the proper direction.
  5. Try it like this: [code] <?php if ($_SESSION['Level']=="Admin") { ?> <a href='add_contactuser1.php'><font color='#000099' size='2' face='Arial, Helvetica, sans-serif'>Add User</font>[/url]<font color='#000099' size='2' face='Arial, Helvetica, sans-serif'> <? } ?> [/code]
  6. I am using the Turorial off of PHP Freaks [a href=\"http://www.phpfreaks.com/tutorial_cat/28/PHP-XML.php\" target=\"_blank\"]PHPFreaks Tutorial[/a] [code] <?PHP function print_error() {     global $parser;     die(sprintf("XML Error: %s at line %d",         xml_error_string(xml_get_error_code($parser)),         xml_get_current_line_number($parser)     )); }     //create xml parser object $parser = xml_parser_create(); //this option ensures that unneccessary white spaces //between successive elements would be removed xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); //to use XML code correctly we have to turn case folding //(uppercasing) off. XML is case sensitive and upper //casing is in reality XML standards violation xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0); //read XML file into $data $data = implode("",file('http://sports.yahoo.com/nhl/rss.xml')); //parse XML input $data into two arrays: //$i_ar - pointers to the locations of appropriate values in //$d_ar - data value array xml_parse_into_struct($parser,$data,&$d_ar,&$i_ar) or print_error(); //to view content of $d_ar and/or $i_ar uncomment lines below //echo '<pre>'; //print_r($d_ar); //print_r($i_ar); //cycle all <item> tags. //$i_ar['item'] contains all pointers to <item> tags for($i=0; $i<count($i_ar['item']); $i++) {     //since we have <item> nested inside another <item> tag,     //we have to check if pointer is to open type tag.     if($d_ar[$i_ar['item'][$i]]['type']=='open') {         //now for all content within single <item> element         //extract needed information         for($j=$i_ar['item'][$i]; $j<$i_ar['item'][$i+1]; $j++) {             if($d_ar[$j]['tag'] == 'caption') {                 $caption = $d_ar[$j]['value'];             }elseif($d_ar[$j]['tag'] == 'url') {                 $url = $d_ar[$j]['attributes']['value'];             }         }         //output link         echo '<a href="'.$url.'">'.str_repeat('=',$d_ar[$j]['level']-1).$caption.'</a><br>';     } } //unseting XML parser object xml_parser_free($parser); /* *tab-width=4       *indent=4 *width=90 */ ?> [/code] I saved the file as rss.php and goto the page and get the following error. XML Error: syntax error at line 1 Does anyone have any ideas why I am getting this meaage? Can you please test this script on your site to see it it works??
  7. I am tring to find a script that can read the following RSS feed for my website. [a href=\"http://sports.yahoo.com/nhl/rss.xml\" target=\"_blank\"]http://sports.yahoo.com/nhl/rss.xml[/a]
×
×
  • 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.