PHP - Rssify Content From Another Site Into Wordpress – With Online-demo
hello dear all, good day dear php-freaks,
i want to rssify content from another website into my wordpress-page: see the source: https://europa.eu/youth/volunteering/project_en well - is it possible to do this? of course - i have to ask bout the permission at the site of source. but the technical site is also interesting :do you think that this is doable!? note: i only am interested in the summary of the data - that is only a little piece of text.
Similar TutorialsI have a wordpress site that has a ribbon graphic on the index page posts that are in the category "features", it works great when it's like this: Code: [Select] <?php //for better seo, we use alt and titles in h query_posts('category_name=features&showposts=4'); while(have_posts()):the_post(); $attrs = array( 'src' => $src, 'class' => "", 'alt' => get_the_title(), 'title' => get_the_title(), );?> <!-- Blog entry --> <div class="blog_entry"> <!-- inside --> <div class="inside"> <!-- Thumbnail --> <div class="thumbnail"> <a href="<?php the_permalink(); ?>" title="<?php the_title();?>"><?php the_post_thumbnail('blogsmall', $attr );?></a> </div> <!-- /Thumbnail --> <!-- Resume --> <div class="resume"><div class="featured_banner2"></div> <h3 class="cufon"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3> <p class="bigline"><?php the_excerpt();?></p> <br> <?php if(function_exists('the_ratings')) { the_ratings(); } ?> </div> <!-- /Resume --> but when going to the category view it doesn't work to just add the Code: [Select] <div class="featured_banner2"></div> as all post types get the ribbon. So I am trying to use a PHP if statement to only apply that featured_banner2 div line to posts with the category name of "features" I am a total php newbie, so far I tried this but it obviously is not right, I am trying though! lol: Code: [Select] <!-- Resume --> <div class="resume"> <?php if ( in_category( 'features' )) { <div class="featured_banner2"></div> } endif;?> <h3 class="cufon"><a href="<?php the_permalink();?>"><?php the_title();?></a></h3> <p class="bigline"><?php echo get_the_excerpt();?></p> </div> <!-- /Resume --> This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=307287.0
Hello everyone,
function get_file_data( $file, $default_headers, $context = '' ) {
/**
The Wordpress Atahualpa theme does not appear to be compatible with php 7.2. I know very little about php. I get the following error message in my error log: I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php),
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<div class="media margin-none"> <a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a> <div class="media-body innerAll"> <h4 class="media-heading innerT"> <a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4> <p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>'; echo '</div> </div> <div class="col-separator-h"></div>'; } echo pagination($statement,$per_page,$page, $url_filtros, $filtros); ?>it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss? Thanks Hi I'm currently in the process of re-developing a website for a client in Wordpress. I've completed the work apart from the fact that on the old site the client has a webpage with an email subscription form for subscribing to a newsletter. The form takes a 'Name' and 'Email Address' and writes these to a MySQL database in the back end. I've tried adding the code to a page in wordpress and have a few plugins which allow PHP code execution on both the sidebar and page but when the button is clicked to submit the subscription nothing appears to happen as on the origonal page. I really need to know whether this type of code could be imported into Wordpress and made to work or how to go about writing a wordpress page that will write to the same database. Any advice on this would be helpful as I'm not a strong php coder. The Code is as follows: There's a contact.php page on the origoanl site that calls inc-mailing-list.php that also referrences a mysqlconnections.php file I've put all the code below for referrence. Origonal Site: contact.php Code: <?php session_start(); $string = strtoupper($_SESSION['string']); $userstring = strtoupper($_POST['userstring']); session_destroy(); ?> HTML PAGE FORMATTING (REMOVED FOR THE POST) <?php include("inc-mailing-list.php"); ?></TD> <script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> try { var pageTracker = _gat._getTracker("UA-9716450-1"); pageTracker._trackPageview(); } catch(err) {}</script></body> </html> INC-MAILING-LIST.PHP <?php require_once('Connections/mysqlconnection.php'); ?> <?php /* In contact.php session_start(); $string = strtoupper($_SESSION['string']); $userstring = strtoupper($_POST['userstring']); session_destroy(); */ ///// Anti sql injection if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } //// Site config $siteName = "South Wales Art Society"; $siteURL = "www.southwalesartsociety.co.uk"; $siteEmail = "info@southwalesartsociety.co.uk"; ///// Establish the current date/time as a variable $now = date('Y-m-d H:i:s'); // Current date //// Call mailing lists mysql_select_db($database_mysqlconnection, $mysqlconnection); $query_callMailingLists = "SELECT * FROM content WHERE contenttype = 501 AND onlinestatus = '1' ORDER BY displayorder ASC"; $callMailingLists = mysql_query($query_callMailingLists, $mysqlconnection) or die(mysql_error()); $row_callMailingLists = mysql_fetch_assoc($callMailingLists); $totalRows_callMailingLists = mysql_num_rows($callMailingLists); //// Unsubscribe if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "elist") && ($_POST["subscription"] == "unsubscribe") && (strlen($_POST["email"]) > 4) && ($string == $userstring) && (strlen($string) > 4)) { $deleteSQL = sprintf("DELETE FROM content WHERE email=%s AND contenttype = 500", GetSQLValueString($_POST['email'], "text")); mysql_select_db($database_mysqlconnection, $mysqlconnection); $Result1 = mysql_query($deleteSQL, $mysqlconnection) or die(mysql_error()); $status = "1"; //SEND CONFIRMATION EMAIL $to = $_POST['email']; $subject = $siteName.' Mailing List'; $body = 'Your email address has been removed from the '.$siteName.' mailing list.' . "\n\r"; $body .= $siteURL . "\n\r"; $headers = 'From: '.$siteEmail . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $body, $headers); } /////////////////// SUBSCRIPTION //////////////////////// // Insert comment if sent and valid if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "elist") && ($_POST["email"] != "") && ($_POST["subscription"] == "subscribe") && ($string == $userstring) && (strlen($string) > 4)) { //////////////////////////////////////////////////////////////////////////////////// ///////////////////////////// COUNT AND JOIN TAGS ////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $tagCombination1 = ""; // Default value to define variable. $tagTotal = ""; // Default value to define variable. if (isset($_POST['TagsTotal1'])) { $tagTotal = $_POST['TagsTotal1'];} $tagNumber = 0; do { $tagNumber = $tagNumber+1; if (isset($_POST['Tag-1-'.$tagNumber])) $tagCombination1 = $tagCombination1.",".$_POST['Tag-1-'.$tagNumber]; // DISREGARD UNSELECTED TAGS } while ($tagNumber <= $tagTotal); // LOOP UNTIL ALL TAGS HAVE BEEN COMBINED $tagCombination1 = $tagCombination1.","; // ADD A COMMA TO THE END TO GET CORRECT SEARCH PARAMETERS $tagCombination1 = str_replace(",,",",",$tagCombination1); // CLEAR OUT ANY DOUBLE COMMAS //////////////////////////////////////////////////////////////////////////////////// /////////////////////////// COUNT AND JOIN TAGS END //////////////////////////////// //////////////////////////////////////////////////////////////////////////////////// $insertSQL = sprintf("INSERT INTO content (contenttype, title1, email, date_added, tags1) VALUES (%s, %s, %s, %s, %s)", GetSQLValueString(500, "int"), GetSQLValueString($_POST['name'], "text"), GetSQLValueString($_POST['email'], "text"), GetSQLValueString($now, "text"), GetSQLValueString($tagCombination1, "text")); mysql_select_db($database_mysqlconnection, $mysqlconnection); $Result1 = mysql_query($insertSQL, $mysqlconnection) or die(mysql_error()); $status = "2"; //SEND CONFIRMATION EMAIL $to = $_POST['email']; $subject = $siteName.' Mailing List'; $body = 'Thank you. Your name has been added to the '.$siteName.' mailing list.' . "\n\r"; $body .= $siteURL . "\n\r"; $headers = 'From: '.$siteEmail . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $body, $headers); } ?> <div id="signup" > <H5>Sign Up For Our Mailing List</H5> <?php if (($_POST['email']) && ($status == "1")) { ?> <br /><strong>Thank you, you have been removed from the mailing list.</strong> <?php } elseif (($_POST['email']) && ($status == "2")) { ?> <br /><strong>Thank you, you have been added to the mailing list.</strong> <?php } else { ?> <form name="elist" method="POST" action=""> <?php if (($_POST['email']) && ($status != "2")) { ?><p class="red"><strong>Please complete your details and enter the code.</strong></p><?php } // Error ?> <br /> Name: <input name="name" type="text" value="<?php echo $_POST['name']; ?>" /><br /> Email: <input name="email" type="text" value="<?php echo $_POST['email']; ?>" /><br /> <input name="subscription" type="radio" id="subscription_0" value="subscribe" <?php if($_GET['unsubscribe']!="yes") { ?>checked="checked"<?php } // ?> /> Subscribe<br /> <input type="radio" name="subscription" value="unsubscribe" id="subscription_1" <?php if($_GET['unsubscribe']=="yes") { ?>checked="checked"<?php } // ?>/> Unsubscribe<br /> <br /> <?php /*?>Select which information you would like to receive:<br /> <?php $tagNumbers = 0; do { $tagNumbers = $tagNumbers+1;?> <label><input <?php if (!(strcmp($row_callMailingLists['id'],1000))) {echo "checked=\"checked\"";} ?> name="Tag-1-<?php echo $tagNumbers; ?>" type="checkbox" value="<?php echo $row_callMailingLists['id']; ?>" /><?php echo $row_callMailingLists['title1']; ?></label><br /> <?php } while ($row_callMailingLists = mysql_fetch_assoc($callMailingLists)); ?><br /><br /> <input type="hidden" name="TagsTotal1" value="<?php echo $totalRows_callMailingLists; ?>" /> USE THE TWO HIDDEN FIELDS BELOW AS THERE IS ONLY ONE LIST <?php */?> <input type="hidden" name="Tag-1-1" value="1000" /> <input type="hidden" name="TagsTotal1" value="1" /> <img src="/captcha/imagebuilder.php" alt="" border="0" /><br /><br /> <small>Please enter the code shown above.</small><br /> <input maxlength="8" size="8" name="userstring" type="password" value="" /><br /><br /> <input name="Submit" type="submit" value="Submit" /><br /> <input type="hidden" name="datesubscribed" value="<?php echo date('Y-m-d H:i:s'); ?>" /> <input type="hidden" name="MM_insert" value="elist" /> </form> </div> <?php } // ?> <?php mysql_free_result($callMailingLists); ?> This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=318539.0 hello - dear phpfreaks,
i portet over a wordpress site to localhost. (an opensuse linux-box) all went nice and was very smooth to do so. after porting over the files and the db; i added the db-name and user-name etc. but nothing more. then i looked at the site http://localhost/mysite i saw the site - but only once - that is very very interesting. i read that i have to do more. Probably these changes - mentioned below are mandantory in order to avoid a blank page cf: https://managewp.com...#comment-148613 The two fields you need to edit are “siteurl” (highlighted above) and “home” (which you may need to navigate to the second page to find). Just click the “Edit” buttons next to each field, and replace the URL contained in “option_value” with “http://localhost/yourfoldername/”. That’s it! If you now navigate to “http://localhost/yourfoldername/”, your site should load up in all its glory. Please note that if you use custom permalinks, you will need to change them to default (in the WordPress > Settings > Permalinks screen) in order for internal links on your site to work. You can of course change the permalinks back to their custom form at any time. question: is this true? Do i need to make these changes to avoid a blank page!? I've used a little PHP but I am not great. Is there any way to take information from a html page written in basic text and have it dynamically displayed. The content I want is found he http://www.kitco.com/texten/texten.html I want to take the information from the following chart - only Metal and Ask and create a ticker. New York Spot Price MARKET IS OPEN Will close in 2 hour 24 minutes ---------------------------------------------------------------------- Metals Bid Ask Change Low High ---------------------------------------------------------------------- Gold 1822.80 1823.80 -12.30 -0.67% 1810.70 1840.90 Silver 41.45 41.55 +0.10 +0.24% 41.08 42.15 Platinum 1844.00 1852.00 -7.00 -0.38% 1826.00 1861.00 Palladium 783.00 788.00 +10.00 +1.29% 775.00 794.00 ---------------------------------------------------------------------- So basically I would just take the word: Gold - $1823.80 Silver - $41.55 Platinum $1852.00 Palladium - $788.00 Can someone help me through this or point me in a direction where I can read more about accomplishing this? I've been searching google for articles but still haven't found what I'm looking for. nofx1728 Hi there,
I want to make script which will execute via crontab every Sunday at 0:01h and will stop at 23:59h. My goal is to put(show) some tekst on the site. The problem is how to put this tekst in the site? I mean I know how to configure Cron Jobs but how to include the tekst in index.php for example?
crontab will be.
1 0 * * 0 /usr/bin/php Start.php 59 23 * * 0 /usr/bin/php Stop.php This might be a very easy problem to solve. I am literally brand new to php. I am trying to create a simple site that will load content depending on what page 'id' is in the URL and if it doesn't exist to show a page for that scenario. eg index.php?id=1 will show the page 1.php It works fine apart from showing an error when there is no id at all, eg www.website.com will show an error but www.website.com/index.php?id=1 will show a page I want to be able to show the homepage if there is no 'id' at all. Code: [Select] <?php $id = $_GET['id']; if(file_exists("./".$id.".php")) { include ("./".$id.".php"); } else { include ("404.php"); } ?> Any help is appreciated Thanks Hey guys ;-) I got a client that asked me today to create him an MLM type website. The first part of my work would be to test if there system works so I need to run a full demo of the multilevel structure. The MLM structure works as follow: 1 person finds 2 members and they then find 2 more each and so on until we reach 100 level deep. If i got this right, At level 5 there will be 25 members At level 10 there will be 100 members At level 20 there will be 400 members At level 40 there will be 1.600 members At level 100 there will be 10.000 members So at the end of the demo there should be 10k members inserted into the table The table looks like this: id, parent, level, under Parent is the ID of the guy that recruited him, level is the level that guy is at (level 1, 2 , 3, 4 or 5) and under is the number of people under him. I need to run a script that will insert all the data into that table so that we can run some test on the liability of the project so we can set the rates right. At first I thought it would be a piece of cake ... but when I started I found out very fast that populating the MLM network 5 level deep is gona be tricky ... my first attempt gave me a result that looks like this: Code: [Select] |0| |1|2| |x|x|3|4| x|x|x|x|x|x|5|6| As you can see the script only grab the last id then adds 2 new members then uses the last one as the parent and starts over ... So my script is useless and I did not figer out how to do everything in 1 step ... Any help would be appreciated. Dear, I have page1.php where there is a iframe with source page2.php. How can I read page2.php? Both the pages are in external website, and if I directly point www.thatsite.com/page2.php, it shows blank page (no error). But if I load www.thatsite.com/page1.php in FIREFOX and use SAVE FRAME AS function, it does save page2.php successfully. Thanks, Hello everyone, Let me start by saying that this is my first post on this forum and that I am quite a noob when it comes to scripting. With that said, here is my problem: I am trying to edit a getID3 demo file properly to retrieve metadata from mp4 files. The code below belongs from the demo file. <?php require_once('../getid3/getid3.php'); $getID3 = new getID3; $DirectoryToScan = '../container'; $dir = opendir($DirectoryToScan); echo '<TABLE BORDER="1" CELLSPACING="0" CELLPADDING="3">'; echo '<TR><TH>Filename</TH><TH>Artist</TH><TH>Title</TH><TH>Bitrate</TH><TH>Playtime</TH></TR>'; while (($file = readdir($dir)) !== false) { $FullFileName = realpath($DirectoryToScan.'/'.$file); if (is_file($FullFileName)) { set_time_limit(30); $ThisFileInfo = $getID3->analyze($FullFileName); getid3_lib::CopyTagsToComments($ThisFileInfo); echo '<TR>'; echo '<TD>'.$ThisFileInfo['filenamepath'].'</TD>'; echo '<TD>'.(!empty($ThisFileInfo['comments_html']['artist']) ? implode('<BR>', $ThisFileInfo['comments_html']['artist']) : ' ').'</TD>'; echo '<TD>'.(!empty($ThisFileInfo['comments_html']['title']) ? implode('<BR>', $ThisFileInfo['comments_html']['title']) : ' ').'</TD>'; echo '<TD ALIGN="RIGHT">'.(!empty($ThisFileInfo['audio']['bitrate']) ? round($ThisFileInfo['audio']['bitrate'] / 1000).' kbps' : ' ').'</TD>'; echo '<TD ALIGN="RIGHT">'.(!empty($ThisFileInfo['playtime_string']) ? $ThisFileInfo['playtime_string'] : ' ').'</TD>'; echo '</TR>'; } } ?> I have added 2 test files in 'container' for testing only. See this image for the result I am getting. As you can see the code isn't retrieving any data at all. Can anyone help me out with this? Thanks in advance, Melissa Hi there, I am working on a PHP Ecommerce website. We have multiple Suppliers on the website listing their products. Now when a customer buys multiple products belonging to multiple suppliers, the payment has to go to those different respective suppliers through a single Paypal checkout. I have come to know that there is a way of doing is using Paypal Parallel payments method. Its he http://feefighters.com/blog/paypal-announces-adaptive-payments-parallel-payments-and-chained-payments-functionality-via-api/ Anybody here has a working demo of how it works. Kindly reply. Thank you! All comments feedback are always welcomed! I have a php tutorial that I followed for creating, inserting, selecting and updating a MySQL database with php. Everything works fine so I wanted to put it into Wordpress. I took the code and placed it into the wordpress page and everything worked just fine except the update function. Here is the tutorial I used. http://www.phpsimple.net/mysql_insert_record.html It is also the part I am having trouble with. I am able to create a record and I am also able to select a record but when I choose "update" the form doesn't load the data. It will outside the website but not inside wordpress. I am hoping this is not vague but because of my inexperience I am not sure what else to say. I will be more than happy to provide any other information you need. good evening dear community! Howdy, at the moment i am debugging some lines of code... purpose: i want to process multiple webpages, kind of like a web spider/crawler might. I have some bits - but now i need to have some improved spider-logic. See the target-url http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50 This page has got more than 6000 results! Well how do i get all the results? I use the module LWP::simple and i need to have some improved arguments that i can use in order to get all the 6150 records Attempt: Here are the first 5 page URLs: http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=0 http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=50 http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=100 http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=150 http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=200 We can see that the "s" attribute in the URL starts at 0 for page 1, then increases by 50 for each page there after. We can use this information to create a loop: #!/usr/bin/perl use warnings; use strict; use LWP::Simple; use HTML::TableExtract; use Text::CSV; my @cols = qw( rownum number name phone type website ); my @fields = qw( rownum number name street postal town phone fax type website ); my $i_first = "0"; my $i_last = "6100"; my $i_interval = "50"; for (my $i = $i_first; $i <= $i_last; $i += $i_interval) { my $html = get("http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50&s=$i"); $html =~ tr/r//d; # strip the carriage returns $html =~ s/ / /g; # expand the spaces my $te = new HTML::TableExtract(); $te->parse($html); my $csv = Text::CSV->new({ binary => 1 }); foreach my $ts ($te->table_states) { foreach my $row ($ts->rows) { #trim leading/trailing whitespace from base fields s/^s+//, s/\s+$// for @$row; #load the fields into the hash using a "hash slice" my %h; @h{@cols} = @$row; #derive some fields from base fields, again using a hash slice @h{qw/name street postal town/} = split /n+/, $h{name}; @h{qw/phone fax/} = split /n+/, $h{phone}; #trim leading/trailing whitespace from derived fields s/^s+//, s/\s+$// for @h{qw/name street postal town/}; $csv->combine(@h{@fields}); print $csv->string, "\n"; } } } i tested the code and get the following results: .- see below - the error message shown in the command line... btw: here the lines 57 and 58: #trim leading/trailing whitespace from derived fields s/^s+//, s/\s+$// for @h{qw/name street postal town/}; what do you think? Sta�e please Ot",,,Telefo,Fax,Schulat,Webseite Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. "lfd. N.",Schul-numme,Schul,"ame Sta�e please Ot",,,Telefo,Fax,Schulat,Webseite Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. "lfd. N.",Schul-numme,Schul,"ame Sta�e please Ot",,,Telefo,Fax,Schulat,Webseite Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. "lfd. N.",Schul-numme,Schul,"ame Sta�e please Ot",,,Telefo,Fax,Schulat,Webseite Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. Use of uninitialized value $_ in substitution (s///) at bavaria_all_guru.pl line 58. "lfd. N.",Schul-numme,Schul,"ame good day, hello dear community! i am currently ironing out a little parser-script. I have some bits - but now i need to have some improved spider-logic. See the target-url http://192.68.214.70/km/asps/schulsuche.asp?q=e&a=50 This page has got more than 6000 results! Well how do i get all the results? I tried out several things - but i dont helped. I allways got bad results. See i have good csv-data - but unfortunatley no spider logic... I need some bits to get there! How to get there!? I use the module LWP::simple and i need to have some improved arguments that i can use in order to get all the 6150 records #!/usr/bin/perl use warnings; use strict; use LWP::Simple; use HTML::TableExtract; use Text::CSV; my $html= get 'http://192.68.214.70/km/asps/schulsuche.asp?q=n&a=50'; $html =~ tr/r//d; # strip the carriage returns $html =~ s/ / /g; # expand the spaces my $te = new HTML::TableExtract(); $te->parse($html); my @cols = qw( rownum number name phone type website ); my @fields = qw( rownum number name street postal town phone fax type website ); my $csv = Text::CSV->new({ binary => 1 }); foreach my $ts ($te->table_states) { foreach my $row ($ts->rows) { trim leading/trailing whitespace from base fields s/^s+//, s/\s+$// for @$row; load the fields into the hash using a "hash slice" my %h; @h{@cols} = @$row; derive some fields from base fields, again using a hash slice @h{qw/name street postal town/} = split /n+/, $h{name}; @h{qw/phone fax/} = split /n+/, $h{phone}; trim leading/trailing whitespace from derived fields s/^s+//, s/\s+$// for @h{qw/name street postal town/}; $csv->combine(@h{@fields}); print $csv->string, "\n"; } } Well - with this i have a good csv-output:- but unfortunatley no spider logic. How to add the spider-logic here... !? well i need some help Love to hear from you I have several "sites" located in my html directory, and each has a "general" access point and an "administrator" access point:
/var/www/html/site1/index.php /var/www/html/site1/administrator/index.php /var/www/html/site2/index.php /var/www/html/site2/administrator/index.php /var/www/html/site3/index.php /var/www/html/site3/administrator/index.phpAll sites are similar except that data will be specific to site1, site2, or site3, etc. Users who log onto /var/www/html/siteX/index.php are totally unrelated to those who logon to /var/www/html/siteX/administrator/index.php, will have different logon credentials, are stored in different DB tables, and each should have their own session. If a user logs off of either the general or administrator site, it should not effect the other site even if they were previously logged on to both on the same PC (and of course not effect other sites). When a user logs off, I would like to destroy their previous cookie and associated session. Users for either will only use https. I am using Apache to rewrite https://www.mysite.com/ to https://mysite.com/. While I named the administrator site "administrator" above, the administrator user has the ability to change the directory name. I am thinking I need to use session_set_cookie_params to specify where I wish the session cookie to be stored since /var/www/html/siteX/administrator/index.php is a sub-directory to /var/www/html/siteX/index.php, but am not really sure. Sorry for the cryptic post, but I am not very well versed in this subject. How would you recommend setting up cookies/sessions for this scenario? Thank you im creating a members website and i want to show how many people are logging, in my database i have a col named online every time somone logs in there online goes from 0 to 1 and when thay log out it goes back to 0. i need to know how to show the total people that have 1 in there online part of the data base iv tryed this code and its not working <?php $result = mysql_query("SELECT online FROM `members` WHERE online='1'"); $row = mysql_fetch_row($result); echo $row; ?> this works in the sql console in phpmyadmin |