[PHP-DB] Fsockopen issues
Is it possible (and advisable) to make multiple Get/head request through one fsockopen handle. eg: $fp = fsockopen($host, 80); $request = GET /one.htm HTTP/1.0\r\n; ... fputs($fp, $request); . //and then, another request through same handle: $request2 = GET /two.htm HTTP/1.0\r\n; fputs($fp, $request2); //i.e through same handle. -- http://ngBot.com | http://wap.ngBot.com Nigeria's #1 website directory.
[PHP-DB] htacces/ php
Any php way of knowing if a site has blocked hot linking to its images? -- http://ngBot.com | http://wap.ngBot.com Nigeria's #1 website directory.
[PHP-DB] Select found_rows problem...
Using the select calc_found rows code (i.e select sql_calc_found_rows * from table where ... limit 0, 10) to get the found fesult irrespective of the limit clause...then using $count = mysql_query(select found_rows()); with the hope of getting the returened result but got this instead: Resource id #7. what could be wrong? -- http://ngBot.com Nigeria's #1 website directory.
[PHP-DB] php line error
just care to know how php does the line counting when it echoes error messages like: parse error: unexpected '}' on line 129 1. does the line counting includes empty lines 2. are externally included files (using include(), require() etc) also line counted(sic)? 3. are d parts of the file that are not in php (i mean that are not contained within the php delimeters) also counted? - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP-DB] getting a variable from a function
As against 'global', is there anyway to get a variable from wthin a function (besides 'returning it using 'return'). for example, how do i get the value of the variable $c in the function below: function Dis() { $a = arry('foo', 'bar'); foreach ($a as $v) { echo $v; } $c = count($a); } - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Yahoo! Mail Stay connected, organized, and protected. Take the tour
[PHP-DB] my dir search
sorry about the volume of this apiece.just thinking it will help you understand my frenzy script better. to start with, it is a simple 'intra' search script that opens include files contained in the dir the visitor wants to searchand match its content with the query. contents of the include files are in plain txt format like this: God is luv. we learn to walk by stumbling php forever and so on. here is the search funtion that does the 'opening' and matching : function search($file) { global $q, $a; $sd = opendir($file); while (($sf=readdir($sd)) !== false) { $line = file($sf); foreach ($line as $content) { if (preg_match($q, $content)) { if (!in_array($content, $a) { $a[] = $content; } } } $c = count($a); return $a; return $c; } it is included in this main script: foreach($_request as $r = $v) { //this declares $in and $q... $$r = $v; // ...which are the directories to be searched and query respectively } include ('dir-search-function.inc'); $q = strip_tags(strip_slashes(trim(strtolower($q; $a = array(); if ($in == 'whole') { // if visitor wants to search all directories $dh = opendir('dir/'); while (($d = readdir($dh)) !== false) { if (is_dir($d)) { search($d) ; } } } else { if (!empty($in)) { search('/dir/' . $in . '/'); // for something like 'dir/arts/' } } if ($c == 0) { // if no match echo 'Sorry, no link and comment was found to contain your query: TT$q/TT in the TT$in/TT directory.BR'; } else{ echo ' TT$c/TT results were found for TT$q/TT in the TT$in/TT directorybr'; foreach ($a as $value) { echo '$value'; } the scrap gave me bugs so guys i need help. by the way, i think you should take a closer look at the search function. im no good at writing functions(cant even do classes), so guess thats where the mistake is lurking. av fun. thanks. :) - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Small Business - Try our new resources site!
[PHP-DB] comprehensive sql tutorial
Does anyone please know where i can get a comprehensive SQL tutorial as in one that contains stuffs on engines, data structures, table types, etc NOT JUST the basic query commands CREATE, SELECT, UPDATE, DELETE, INSERT... their syntax(es). - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Small Business - Try our new resources site!
[PHP-DB] php/js
hi guys, sorry about making this stupid comparisons but i hope someone help me with them. Simply, I'd like to know php functions that are equivalent to this javascript functions: 1.document.lastModified // displays date document was modified as reported by server 2.var php = 'php forever!' document.write(php.big()) // outputs bigphp forever!/big - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Small Business - Try our new resources site!
[PHP-DB] redirecting function
hi folks, who knows any function that can do this javascript trick script window.location='http://somewhere.com/' /script tried header(location:http://somewhere.com/) but it gave me an errorinclude() on the other hand only includes the url doest redirect to it... thnx - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Make Yahoo! your home page
[PHP-DB] max character size mysql can contain
Hi guiz, I was just wondering if anyone has an idea the maximum size of characters(in bytes) a mysql database can contain thanx - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less.
[PHP-DB] fread()
Hi All, I'd just like to know if it is possible to use fread to read the html content of a serverside coded pageas in something like this: ?php $filename = /usr/local/something.php; $handle = fopen($filename, r); $contents = fread($handle, filesize($filename)); fclose($handle); ? - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term'
[PHP-DB] insert (database)
the objective of the script below is to first search if a subscriber is already in a list before subscribing his email (so as to prevent double subscription). the select part works finebut the insert doesnt. know why? if ($v = strtolower($_POST['email'])) { $db = mysql_connect(mysql, usser, pw); $con = mysql_select_db(ng,$db); $sql = SELECT * FROM mytable WHERE email='$v'; $res = mysql_query( $sql ) ; if ($row = mysql_fetch_array($res)) { echo bYour email: u$v/u already in the listbr; } else { $sql_in = INSERT INTO arcadia ('email') VALUES ('$v'); $result_in = mysql_query($sql_in); echo bYour email: u$v/u subscribed!br; } } else { include(index.php); exit; } - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term'
[PHP-DB] flush()
I dont seem to understand the description for flush() in thew php websitehope someboody can tell me what it is really about. - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Search presents - Jib Jab's 'Second Term'
[PHP-DB] foreach()
Hi folks. wat can be done to dis: $z = array('foo' = array('bar')), 'dis' = array('dat')); foreach(//???) { echo //??? br //?? /p; } to output dis: foo bar dis dat - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? The all-new My Yahoo! What will yours do?
[PHP-DB] fopen
Hi list, How can I get the file name of the home page of a url I opened with fopen() this way: $handle = fopen(http://www.example.com/;, r); ? - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP-DB] mysql Index table
just want to know if mysql automatically update an index table if new datas are inserted into the original table. for example, if i insert a row of data to a table I'have already created an index table for, would mysql add the row to the table? - A passion till tomorrow, Opeyemi Obembe | ng.clawz.com - Do you Yahoo!? Yahoo! Mail - 250MB free storage. Do more. Manage less.
[PHP-DB] mysql_array_array
The following script: html headtitleShare the fun!/title/head style type=text/css !-- body { font: normal 10px verdana; background: #ff url(arc.gif) 120px 70px no-repeat; } input { border: 1px solid #ff9966; text-align:right; } u { color: #ff; } -- /style body pnbsp;/p pnbsp;/p center ?php if ($v = strtolower($_POST['email'])) { $host = mysql ; $user = myusername ; $pass= mypassword ; mysql_connect($host , $user , $pass ) ; mysql_select_db(ng) ; $sql = SELECT * FROM arcadia WHERE email=$v; $res = mysql_query( $sql ) ; if (list($row) = mysql_fetch_array($res)) { echo bYour email: u$v/u already in the listbr; } else { $sql_in = INSERT INTO arcadia ('email') VALUES ('$v'); $result_in = mysql_query($sql_in); echo bYour email: u$v/u subscribed!br; } } else { header(location : http://ng.clawz.com/index.php;); exit; } ? /center /body /html gives the error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/ng/subscribe.php on line 32 the concept of the script is to first see if the subscribed email is not already in the list (to prevent double subscription) before subscribing. but dis always come out wit d above error. what do you think could be wrong? - A passion till tomorrow, www.opeyemi.tk __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP-DB] Functions
Hi wizs, Anybody knows any fuction that can count occurence of a character in a string (not in a array). - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Discover all thats new in My Yahoo!
[PHP-DB] talking Robots
Hi folks, I'd luv to know: 1. if it is possible to write a robot in PHP; 2. how a query can be ran faster in mysql. i heard of hasing but i seem not to understand the whole concept. 'd be glad if someone can help though. Tahnks for the usual cooperation. - Do you Yahoo!? Meet the all-new My Yahoo! Try it today!
[PHP-DB] readdir
Hi folks, Just want to know if a full url (as in something like http://www.example.com) can be opened as a directory using the function readdir(). if it cant, does anybody know any function that can? - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Check out the new Yahoo! Front Page. www.yahoo.com
[PHP-DB] RegEx
i'd luv to know wat happens if a value is to be taken from within a certain tag in a page when there are more than one of the tags in the page. for example, if i'd luv to tkae all data from within EVERY bold tags in a page, will this work: $file = http://example.com/; $open = fopen($file,r); $read = fread($open, filesize($file)); $search = eregi(b(.*)/b, $read, $value); and by the way, i'd also luv to know more about Regular Expressions. I'd be very happy if someone can refer me to a nice tutor page. thanx. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
[PHP-DB] Mysql_fetch_array
Does anyone have an idea what may probably be the cause of this error: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /var/www/ng/mailsender2.php on line 17 - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Y! Messenger - Communicate in real time. Download now.
[PHP-DB] functions via event handlers
i'd just luv to ask if it is possibble to call a function in PHP by using event handlers (like onmouseover, onload) as done in javascript? if its possible, i'd appreciate someone to tutor me on it. - A passion till tomorrow, www.opeyemi.tk - Do you Yahoo!? Win 1 of 4,000 free domain names from Yahoo! Enter now.