Everything posted by Anton
-
Import Huge ammount of data into MySQL using PHP
Is there a way to split XML file by parameter using PHP?
-
Import Huge ammount of data into MySQL using PHP
Uploaded a file smaller one about 150 mb, contains 99.000 records, run my script page was loading for about 10 mins than it said done, but only 15000 records were inserted, it would be nice to install MySQL XML parser but i am on shared hosting unfortunatelly so no chance, plus XML file and MySQL databse have differen names for tables
-
Import Huge ammount of data into MySQL using PHP
Hi, i got an XML about 420 mb in size , i need to import it into my database, ive done a little script that does that, but here is the problem, there are about 500.000 records in it! How can i stick all that into Database? is it possible to split XML somehow or any other method?
-
Add no follow
Here is the whole thing <?php //<div style="font-size: 16px;">If you see this, your server does not support PHP. Ask your web-hosting provider where you can add the PHP code on your website.</div> /*ERROR<!--*/ class TNX_l { var $_login = 'login'; // your TNX login var $_timeout_connect = 60; // timeout - maximum time for the links to load (in seconds) var $_connect_using = 'fsock'; // curl or fsock - you may choose the way to connect var $_html_delimiter = '<p>'; // link devider - symbol between links (you may choose any symbol) var $_encoding = ''; // your website encoding. You may also use: KOI8-U, UTF-8, iso-8859-1 (iconv module must be installed on your server) var $_exceptions = 'PHPSESSID'; // here you can list URL's that you don't want to be indexed by TNX. Basically, those are URLs that are not indexed by search engines, or links to pages that don't exist. Don't change this value after it has been indexed by TNX system. /*******************************/ var $_return_point = 0; var $_content = ''; function TNX_l() { if($this->_connect_using == 'fsock' AND !function_exists('fsockopen')){echo 'fsock function is disabled on your server, contact your provider or try to use the CURL version of the TNX code.'; return false;} if($this->_connect_using == 'curl' AND !function_exists('curl_init')){echo 'Error, CURL is not supported, try using fsock.'; return false;} if(!empty($this->_encoding) AND !function_exists("iconv")){echo 'CURL function is disabled on your server, contact your provider or try to use the fsock version of the TNX code.'; return false;} if ($_SERVER['REQUEST_URI'] == '') $_SERVER['REQUEST_URI'] = '/'; if (strlen($_SERVER['REQUEST_URI']) > 180) return false; if(!empty($this->_exceptions)) { $exceptions = explode(' ', $this->_exceptions); for ($i=0; $i<sizeof($exceptions); $i++) { if($_SERVER['REQUEST_URI'] == $exceptions[$i]) return false; if($exceptions[$i] == '/' AND preg_match("#^\/index\.\w{1,5}$#", $_SERVER['REQUEST_URI'])) return false; if(strpos($_SERVER['REQUEST_URI'], $exceptions[$i]) !== false) return false; } } $this->_login = strtolower($this->_login); $this->_host = $this->_login . '.tnx.net'; $file = base64_encode($_SERVER['REQUEST_URI']); $user_pref = substr($this->_login, 0, 2); $md5 = md5($file); $index = substr($md5, 0, 2); $site = str_replace('www.', '', $_SERVER['HTTP_HOST']); $this->_path = '/users/' . $user_pref . '/' . $this->_login . '/' . $site. '/' . substr($md5, 0, 1) . '/' . substr($md5, 1, 2) . '/' . $file . '.txt'; $this->_url = 'http://' . $this->_host . $this->_path; $this->_content = $this->get_content(); if($this->_content !== false) { $this->_content_array = explode('<br>', $this->_content); for ($i=0; $i<sizeof($this->_content_array); $i++) { $this->_content_array[$i] = trim($this->_content_array[$i]); } } } /*!!!*/ function show_link($num = false) { if(!isset($this->_content_array)) return false; $links = ''; if(!isset($this->_content_array_count)){$this->_content_array_count = sizeof($this->_content_array);} if($this->_return_point >= $this->_content_array_count) return false; if($num === false OR $num >= $this->_content_array_count) { for ($i = $this->_return_point; $i < $this->_content_array_count; $i++) { $links .= $this->_content_array[$i] . $this->_html_delimiter; } $this->_return_point += $this->_content_array_count; } else { if($this->_return_point + $num > $this->_content_array_count) return false; for ($i = $this->_return_point; $i < $num + $this->_return_point; $i++) { $links .= $this->_content_array[$i] . $this->_html_delimiter; } $this->_return_point += $num; } return (!empty($this->_encoding)) ? iconv("windows-1251", $this->_encoding, $links) : $links; } function get_content() { $user_agent = 'TNX_l ip: ' . $_SERVER['REMOTE_ADDR']; $page = ''; if ($this->_connect_using == 'curl' OR ($this->_connect_using == '' AND function_exists('curl_init'))) { $c = curl_init($this->_url); curl_setopt($c, CURLOPT_CONNECTTIMEOUT, $this->_timeout_connect); curl_setopt($c, CURLOPT_HEADER, false); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); curl_setopt($c, CURLOPT_TIMEOUT, $this->_timeout_connect); curl_setopt($c, CURLOPT_USERAGENT, $user_agent); $page = curl_exec($c); if(curl_error($c) OR (curl_getinfo($c, CURLINFO_HTTP_CODE) != '200' AND curl_getinfo($c, CURLINFO_HTTP_CODE) != '404') OR strpos($page, 'fsockopen') !== false) { curl_close($c); return false; } curl_close($c); } elseif($this->_connect_using == 'fsock') { $buff = ''; $fp = @fsockopen($this->_host, 80, $errno, $errstr, $this->_timeout_connect); if ($fp) { fputs($fp, "GET " . $this->_path . " HTTP/1.0\r\n"); fputs($fp, "Host: " . $this->_host . "\r\n"); fputs($fp, "User-Agent: " . $user_agent . "\r\n"); fputs($fp, "Connection: Close\r\n\r\n"); stream_set_blocking($fp, true); stream_set_timeout($fp, $this->_timeout_connect); $info = stream_get_meta_data($fp); while ((!feof($fp)) AND (!$info['timed_out'])) { $buff .= fgets($fp, 4096); $info = stream_get_meta_data($fp); } fclose($fp); if ($info['timed_out']) return false; $page = explode("\r\n\r\n", $buff); $page = $page[1]; if((!preg_match("#^HTTP/1\.\d 200$#", substr($buff, 0, 12)) AND !preg_match("#^HTTP/1\.\d 404$#", substr($buff, 0, 12))) OR $errno!=0 OR strpos($page, 'fsockopen') !== false) return false; } } if(strpos($page, '404 Not Found')) return ''; return $page; } } $tnx = new TNX_l(); echo $tnx->show_link(1); // first link echo $tnx->show_link(1); // second link echo $tnx->show_link(1); // third link echo $tnx->show_link(); // remaining links /*-->*/ ?>
-
Add no follow
Hi there, really need some help here, i got a peace of code that gets links from another websites database and shows those on my website, here is the bit of code that outputs the links echo $tnx->show_link(1); // first link echo $tnx->show_link(1); // second link echo $tnx->show_link(1); // third link echo $tnx->show_link(); // remaining links what i want is to extract <a href=""> </a>and add nofollow attribute to it, any suggestions? Thanx
-
PHP and Microsoft word documents
i am more interested in old ones, and is there a way to do it without installing any packages?
-
PHP and Microsoft word documents
it is preferable for the task to run on demand, so i could just stick that stuff right into the database MySQL without having to keep the document on the server
-
PHP and Microsoft word documents
Hi got a question is there a way to read ms word documents using php? searched for ages all i was able to find is various discussions on how bad the microsoft products are... blha blah blah... what i want is to convert ms word document into html using php and store that in database is there a way to do that?
-
google analytics question
Do you have google's code inserted just before </body> in every page of your website? Coz i got similar problem it tells me that there were 30-40 people but i know for a fact that there are a lot more people visiting But i know it is my fault since the codes are not on every page of my website
-
Screen size
why don't you just make it stretch itself according to browser size, that's what i do with all of my websites
-
Google back links and webmaster tools
Hi, this is something that was bothering me since i started using googles webmaster tools In webmaster tools google tells me that there are over 700 backlinks to my home page but if I'll check back links in actual google Like this it tells me that there are only two, well today at least, it was 6 last night and a week ago i had a page rank of 2! now it's 0
-
Please review my website
I guess I will spend a lot more time getting all the errors out the way and making it nore user friendly, the thing is when i started i've never thought to make it public, i just was experementing, but ever since the first ad was posted i stuck with it, changing and optimising... next time I'll ask a designer to get me a layout done
-
Please review my website
Thanx for reviews, i know about all of those errors it's just I want to sort out links and directories first of all, as there is a mess!! So many file I have no idea what goes where in it, about navigation thanx for the suggestion, I'll defenetly try it, but there is onw thing that wories me, will it fit in smaller screen? it streches itself according to resolution of the users screen, but if i will put all the buttons on top? well I'll try it anyway.
-
Please review my website
Hi, here is my Website this is the first website I wrote in php and it took me quite a while to develop it, didn't have enough time time I am looking for reviews on design and maybe some suggestions on how to make it easier to use only main domain was done by me, subdomains are just installed aplications and there might be a few issues with links (SEO optimisation in progress) Thanx
-
How to selct information by the first letter?
Well, It was very very cheap in fact free for a year, anyway i was building that website for the purpose of practice so i guess it is time to move to a proper hosting and build it as good as i can and let it be, so i'd finally have something for my portfolio
-
How to selct information by the first letter?
I wish i knew that before i have purchsed that hosting
-
How to selct information by the first letter?
Those were disabled for some strange reason they say it is something to do with the performance, i have managed to create a search engine without using like but I'd rather have like % working saves a lot of time, well thatnks for the advise, im gonna go talk to that guy
-
Whole website from one template
Thanx for the advice, have done that, but the thing a am actually looking for is something like shop script uses (can be downloaded for free) how ever I'm only a begginer so i can't quite work out how does it work
-
How to selct information by the first letter?
Hello, I'm in the middle of building something and I need some help, I need to select some text from a database by the first letter of the first word excluding "the" and "a" Like if it was a movie directory and user would select a letter and all the movies starting with the selected letter would come up I have found an article about that suggesting using "Like %" but there is a problem my server would not accept this operator :-( so any suggestions plz!??! Thank you
-
Hello everyone
Hello everyone. Just wanted to inroduce my self, hope I have finaly found a community i was looking for, I have done some websites, and doing multimedia technology in University now. However I'am really bad at graphics design, I'm more of a coder well hope to get some advice when i'll need it and i will laso try and give some advice. I wish i had some more spare time to get my website done
-
Saying Hello
Hello I'm new here as well, just seen the massage, i was hosting my websites on streamline.net thay have very generous trafic but im not sure about all the stuff they give you if you are getting a resseler account.
-
Whole website from one template
Hello, I'm new here, and i have a big question. I have a website which is a project of my own, i've got so many pages on it i can't even count, it's infact endles just like forums or any other dinamic website, i have written it in PHP, but recently after another lecture in university about layouts I have decided to change the ley aout on my website, but here is a problem i have too many pages to be changed, I know there is a way to change everything by simply uploading a template ( like in phpBB ) so i'm vondering if some one could point me to some tutorial on the internet of how to build such application.