|
-
CMF for web2.0 projects
Date: 11/20/07
Keywords: php, mysql, database, sql, web
Regards,
This is situation, i have a task on my work to update group of ours sites with using of web2.0 technologies
Engine writed on php5.2 & mysql5
It's simple MVC engine, that i have used over a one year in my projects. So, now i need to rewrite it and i must do it in any cases.
I thin, somebody may interesting on it to have community project?
I need some help with ajax and sql databases designing. U can help me with translation if u want - u see - my english is wery bad ;) (i'm from russia)
with any questions please contacts me with my icq 480.814.094 thanks
Source: http://community.livejournal.com/php/597187.html
-
Open Source PHP4 Search Engines?
Date: 11/16/07
Keywords: php, mysql, html, sql, web
Hello Friends
I want to add a search functionality to a project I am working on. I'd like the search function to index text held in several MySQL tables and then generate a list of keywords to be stored in another table. I do not want a web crawler or an indexing function that indexes files on the filesystem.
The search function will then access this table of keywords in order to find matching documents, and hopefully return them in order of relevance.
I know of this project: http://www.phpguru.org/static/PorterStemmer.html However, it is PHP5 only. The PHP4 project it borrows from, http://www.chuggnutt.com/stemmer.php may or may not work, but it seems to perhaps be buggy.
Anyone have any recommendations for such a project?
Thanks!
Source: http://community.livejournal.com/php/596534.html
-
Verifying mail function is available
Date: 11/15/07
Keywords: php
Hi... I am writing a simple mail script and the server doesnt seem to be sending the mail. I don't get any errors on the screen (nor a blank screen) and I am waiting for access to the logs (I know!).
Anyway, I was looking at php_info and I couldn't determine if mail was on or off. Is there a way to figureout if the mail function is off without having access to the control panel? I have FTP access...
Source: http://community.livejournal.com/php/596430.html
-
OK I admit it this is my favorite error message
Date: 11/15/07
Keywords: php
A favorite PHP error message:
PHP Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM,
expecting '&' or T_VARIABLE in xxxxxxx.php on line xxxx
Source: http://community.livejournal.com/php/596146.html
-
URL normalization
Date: 11/14/07
Keywords: php
Howdy!
I’m interesting in function for URL normalization. On PHP, of couse.
It is not so difficult to write it on one’s own, but I’m still searching ready solution.
Do anybody know about this?
Source: http://community.livejournal.com/php/595898.html
-
How to call standard PHP error handler and die script execution?
Date: 11/09/07
Keywords: php
The problem is: I want to call standard PHP error handler and die script execution after it. I need in standard PHP error handler for writing error to syslog.
I have defined my errorHandler():
function errorHandler($errno, $errmsg, $filename, $linenum) {
exit;
}
set_error_handler(errorHandler);
All works, but standard PHP error handler are not calling. OK, I delete “exit;” and write “return false;” instead of it — standard error handler are calling, but script continue execution.
Of course, I can write error to syslog by myself and it is not difficult but I would to find other way.
Source: http://community.livejournal.com/php/595604.html
-
DBA (db4) as cache before MySQL
Date: 11/08/07
Keywords: mysql, sql
I’m thinking about that:
What about using DBA (db4) before connecting to MySQL for speed-up and reduction server loading.
I want to store document last-modified time and select it by URI-key. Then compare it with request header “If-Modified-Since” and if visitor have actual cache — send status code 304 (Not Modified) and don’t connect to MySQL.
I just interesting, what about DBA perfomance in compare with MySQL? Will it have a matter?
Source: http://community.livejournal.com/php/595432.html
-
Fatal error: Allowed memory size of ... exhausted
Date: 11/08/07
Keywords: php, browser, google
Are there any known issues with file() causing Fatal errors? A production script died on a scheduled file import this morning, it's crashing on this line:
$lines = file($fullfilepath);
- From the error log:
- PHP Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 72 bytes) in...
If I access via a browser the script pops up a "save as" box with scriptname.php as the file to save.
The script works fine on similar test files. If I change to
$blah = file_get_contents($fullfilepath);
The script doesn't die.
I looked around on google but keyword "file" turns up everything but what I need.
Source: http://community.livejournal.com/php/595027.html
-
Removing a line wrap
Date: 11/07/07
Keywords: no keywords
I'm stuck trying to remove a line wraps from a string:
$str = " `val_div_phe_value`, `val_div_phe_status`, `met_div_phe_value`, `met_div_phe_status`
";
So I tried this:
$str = str_replace('\r', '', str_replace('\n', '', $str));
No luck.
Any ideas?
Answer Digitalsidhe noticed that I was using single quotes. To look for and replace special characters like \n double quotes must be used.
$str = str_replace("\r", '', str_replace("\n", '', $str));
Source: http://community.livejournal.com/php/594835.html
-
Unknown column __ in 'field set' part 2
Date: 11/05/07
Keywords: php, mysql, sql
ok, still banging my head against this one. Here's some more information.
Output from PHP/MySQL on attempted insert: Error in query: INSERT INTO regTable (area) VALUES ('West_Coast'). Unknown column 'area' in 'field list'
However, when I run that query on its own in the CLI or phpMyAdmin it works fine. It can be any valid column in that table and it still creates the same error.
Here's the PHP/MySQL code, maybe the issue is with how I'm using the $_REQUEST array or concatenating the string for the query. In addition and just to eliminate possibilities I tried copying the output query from the script and putting it in as a static query in the same script and it works fine that way as well.
Still at a loss.
$query = "INSERT INTO regTable (area) VALUES ('".$_REQUEST['area']."')"; // $query = "INSERT INTO regTable (area) VALUES ('West_Coast')"; $result = mysql_query($query) or die ("Error in query: $query. " . mysql_error());
Source: http://community.livejournal.com/php/594655.html
-
PHP/MySQL : Unknown column 'column_name' in 'field list'
Date: 11/05/07
Keywords: php, mysql, sql, google
I've already scoured google in relation to this issue and so far have found many solutions, none of which seems to work.
PHP 4 MySQL 4.1.20
The script I'm working on at the moment returns a MySQL error : Unknown column 'column_name' in 'field list' Where column_name can be any valid column for the table. I've changed the order and the query insert style several times, restarted the MySQL server, and various other rain dances, all with the same results.
Here's a brief overview of the query that the script generates, it works fine when run directly in MySQL so I'm guessing there's something funny going on with the PHP/MySQL interface.
INSERT INTO table (area, type, city, state, cost, status, capacity, allowed, description, link, startdate, regclose, enddate, over18, gender, level1, level2, level3) VALUES ('East', 'eryery', 'sdfaf', 'CA', '1', 'C', '1', 'N', 'ewt', 'yerr', '2007-05-04 01:00:00', '2010-01-01 01:00:00', '2011-01-01 01:00:00', '1', 'M', '1', '1', '1')Error in query: INSERT INTO table (area, type, city, state, cost, status, capacity, allowed, description, link, startdate, regclose, enddate, over18, gender, level1, level2, level3) VALUES ('East', 'eryery', 'sdfaf', 'CO', '1', 'C', '1', 'N', 'ewt', 'yerr', '2007-05-04 01:00:00', '2010-01-01 01:00:00', '2011-01-01 01:00:00', '1', 'M', '1', '1', '1'). Unknown column 'area' in 'field list'
Any ideas anyone? I generally try and hammer these things out on my own but this one's just too busy givnig me a migraine after working on it for so long. Still with no idea how to start on it.
Source: http://community.livejournal.com/php/594338.html
-
Date Difference
Date: 11/05/07
Keywords: no keywords
Hi all. I need to show difference between two dates. I have dates 03-30-1999 and 11-05-2007(todays date). Result must be something like: It's 7 years, 8 months and 25 days from 01-01-1999. Help me please. p.s. When I try to show it by $years = (mktime1()-mktime2())/2628000 $months = (mktime1()-mktime2())/31536000 $days = (mktime1()-mktime2())/86400 It's not too accurate :-(. ps sorry for bad english :-)
Source: http://community.livejournal.com/php/594170.html
-
Yet another mod_rewrite question: tilde home directory expansion
Date: 11/04/07
Keywords: web, apache
Mod_rewrite seems to be the flavour of the month. I'm trying to use it on a web server that's currently set up without a domain (the domain will be switched to this server when development is finished). So the currently the site lives on a url similar to: http://webhost-14.test.com.au/~goc/
But the catch is that the expansion: http://webhost-14.test.com.au/home/goc/ is not true. So when mod_rewrite expands it I get a 404. :(
Sooo... how do I tell mod_rewrite not to expand home directories?
"Home directory expansion When the substitution string begins with a string resembling "/~user" (via explicit text or backreferences), mod_rewrite performs home directory expansion independent of the presence or configuration of mod_userdir." Apache man
Source: http://community.livejournal.com/php/593745.html
-
Parsing XML
Date: 11/03/07
Keywords: xml, sql
I'm having some problems parsing an XML file. For instance, I have a tag that looks like this:
ANONYMOUS: Hors envyeux, retirez vous d'ici
The function that reads the data from the tag assembles an SQL statement out of all the various tags. The code for this TITLE tag looks like this:
$SQL.= 'and title="'.$data.'" ';
If the data contains " it parses fine, since the data is surrounded with single quotes, but when ' comes through, it truncates the string. As I write all this out and think about the problem, my initial idea is to check the $data for either " or ' and then use a properly formatted SQL statement for the corresponding single or double quote. Anyone have a better idea? Thanks
Source: http://community.livejournal.com/php/593589.html
-
(Self Submitting) Form Structure
Date: 10/30/07
Keywords: php, css
I have a Form that resides right in the middle of some fairly complex CSS created by another person. (I talked him into letting me practice on his code!)
The structure is as follows:
If page 1 submitted Check/Sanitize results from Page 1 If fail set error variables continue on If pass Set "Page One Pass" variable and continue on If page 2 submitted Check/Sanitize results from Page 2 If fail set error variables and continue on If pass give “Thank You” Set variable to prevent Page 2 from drawing Check for “Thank You” variable, if it doesn’t exist Check for "Page One Pass" variable, and if it does exist Draw Page 2 Set "Page 2" draw variable Check for Page 2 and “Thank You” variables, if they don’t exist Draw Page1
I was speaking to a programmer friend of mine (who doesn’t work in php), and he suggested that I write sequentially. Example: Draw Page 1 Check Page 1 Draw Page 2 Check Page 2 If pass give “Thank You"
But I can’t see how to do that without using Functions, and with Globals turned off—it’s kinda’ a pain. I thought about using nested While Loops, but that seemed more confusing.
I don’t know if what I just wrote is even remotely understandable…but if you can make sense of it, I’d love to hear your thoughts!
Thank You!
Source: http://community.livejournal.com/php/592984.html
-
code obscurity is always fun
Date: 10/22/07
Keywords: no keywords
$query .= vsprintf('%s=:%s'.str_repeat(', %s=:%s',count($propNames)-1), array_merge(array(array_shift($propNames)), $propNames));
It could be worse...
Source: http://community.livejournal.com/php/592784.html
-
Detecting duplicates in an array
Date: 10/18/07
Keywords: no keywords
array_unique removes duplicates from an array, but how can I check to see if there are duplicates in an array?
Source: http://community.livejournal.com/php/592308.html
-
Webroot annoyances
Date: 10/17/07
Keywords: php, security, web
Does anyone have some sort of clever idea for this.
Imagine that you have a series of nested folders.
URL/A URL/A/images URL/A/B URL/A/C
Now normally the website for C would be URL/A/C/index.php and using img src='/A/images/something.jpg' would work just fine.
Except that for some reason we have another domain name / url prefix that points the web root to URL/C. Meaning img src='/A/images/something.jpg' does not work because now it is looking at /A/A (folder does not exist)/images/something.jpg.
Still more annoying, our users are retarded sheepish and afraid of warnings from IE in the event of say using a full filepath ( http://URL/A/images/image.url ) since the domain is different it throws a security warning that "we cannot afford to have". Argh.
I have no control over the domain name and it is not going away anytime soon much to the rest of our grievances. Does anyone have an "easy" way to deal with this problem? I suppose I could use $_SERVER['DOCUMENT_ROOT'] to detect it, but that seems like an awful lot of work, considering I'll have to do it for every image on the stupid site.
(this is why people should not be allowed to access the same webpage from multiple URLs *grumble*)
Source: http://community.livejournal.com/php/591911.html
-
Hi guys. I need help in PHP spam protection (captcha)
Date: 10/17/07
Keywords: php, html, web, spam
I don't know PHP absolutely. I have a PHP e-mail form on my website (http://www.toondra.ru/en/contact.htm) and I have problems with spam. Can you help me and add Captcha code to HTML code of that page? I found that (http://captchator.com/test.php.txt) but it's hard for my understanding :)
If you can help me please send me fixed PHP page (http://www.toondra.ru/en/contact.htm)
Thank you!
Source: http://community.livejournal.com/php/591689.html
-
image galleries
Date: 10/16/07
Keywords: mysql, database, sql, web
hi all!
I'm in need of an image gallery script, and was wondering if anyone had any suggestions? I've been browsing around and testing a few and can't quite find one that matches what i need.
i need to be able to upload the photos via the website, for thumbnails to be created and then clicking on the thumbnail takes you to the full size image.
However, all the scripts i've found, when making the thumbnails, make them square, where as i'd prefer it to be more dynamic. So say each thumbnail had a height of 90px, and the width was determined from the full size image, rather than being fixed to 90px aswell. That way when displayed on the page, tall images don't look squashed.
Any scripts out there like that? I don't mind if it is linked to a mysql database or not, tho most don't seem to be.
Ideally it would be seperated into admin area and display area, so that i can customize the look of the displayed photo pages.
Source: http://community.livejournal.com/php/591172.html
|