Re: [PHP] Create a Bulletin Board
Jimmy Bäckström wrote: > > Yo! > I'm thinking of writing a bulletin board and I wonder about threads. I want the >board to be built on threads but I don't know how to do it. I want it to look >something like this: > > subject 1 >| >|__ reply1 to 'subject 1' >| | >| |__ reply1 to 'reply1 to subject 1' >| | >| |__ reply2 to 'reply1 to subject 1' >| >|__ reply2 to 'subject 1' > > This is important to me so I'm thankful for any help I can get! > > //Broder I did it this way for a vbulletin/ubb style board which also does threading thread table has in it a coloumn thread_counter messages table has a column thread_order So say there is thread 1 thread counter goes to 1 order is 1 2nd post someone replies to 1 order is 1.2 (2 comes from thread counter) 3rd post - a reply to 2nd post order is 1.2.3 4th post - someone replies to 2nd post order is 1.2.4 and so on and so on so you can get a threaded view in one sql call. Im using postggresql., interbase and sybase and to do the creation of thread orders I use triggers. Working out the ordering directly in php would really suck - you could get problems with concurrent updates. I never considered MYsql because of it's lack of triggers, stored procedures etc etc People say these are uneccessary but I tend to disagree. They save you a ton of clunky php and help speed things up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Webmin
Michael Kimsal wrote: > > Although I somewhat agree with the webmin sentiment, > after having tried to do simple maintenance on a cobalt for someone, > it seems a real dog for anything outside the normal scope of what > they want you to do. We needed to edit an httpd.conf file, > but there doesn't seem to be a way to do it. Ditto for restarting Apache. > Add a MIME type? No dice. > > Webmin is not the slickest interface, but seems to offer a lot of flexibility. > > Rather than rewriting something, perhaps you could vounteer to design > a better interface for existing webmin stuff. > > A PHP-based version of webmin would be nice, but it's already a rather > developed project, and after considering how to do it myself, I realized > there's a whole hell of a lot of configurations and systems to have to > consider beyond my few linux distros. > > John Huggins wrote: > > > You mention a large desire for a good web based administrator. I wonder if > > there is a version of a web based system administrator available that works > > like Cobalt, but can be installed on any hosting setup. Have you folks > > heard of such a thing? I am aware of Webmin, but am not too impressed with > > it yet. > > > > I have toyed with the idea of writing my own. Jamie, what items do you feel > > must be controllable in a web hosting account administration panel? Yes, we > > all know the basics, like email, dns, etc. but a bulleted list would be a > > good start at organizing a development effort. > > Ive written something in php - lets you edit your apache, dns email etc. But its for qmail/vmailngr and tinydns set up. It lets the people on my server do all their dns, apache etc without hassling me about it. A whole webmin type thing in php would be a real pain. The interface is useful when you have a large number of domains and want others to administer them - the people on my server have around 50 + domains each - so having a web interface for it is actually pretty quick. For a few domains it's overkill. at 4php.com there are some screenshots of it. It's not that hard to put something together similar yourself. I absolutely hate control panels and have vowed never to touch my code again. Write one and it will drive you mad. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PostgreSQL vs InterBase
Arnold Gamboa wrote: > > I hve heard a great deal about InterBase. Please comment on which is > better: > > 1. Speed > 2. Data Reliability > 3. Compatibility with PHP > > Thanks for your comments. > > -- 1. I think Postgresql 2 and 3 I can't say which is better. Both seem to work ok - you might want to search for postgresql and persistent connections in the archives - seems they aren't perfect yet. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Temporarily turning off magic quotes?
Ben Cheng wrote: > > If I have magic quotes turned on for post/get/etc. in my php.ini, is > there any way to temporarily turn it off for one page? For example, > I have a preview page inbetween my data entry page and the page that > actually saves to db. I don't want magic quotes turned on when going > from the data entry to the preview page since all quotes keep getting > backslashed. Is there a way to do this? > > -Ben > For php4 look for ini_alter under www.php.net/manual/en/ref.info.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Unwanted Characters
Clayton Dukes wrote: > > How do I remove unwanted/unprintable characters from a variable? > > $sometext = "ThÀe cØar röøan over mÖy dog" > needs to be filtered and reprinted as: > "The car ran over my dog" > > Thanks :-) > Clayton Dukes will print what you asked - of course you may not want numbers but you get the idea. I do this check on all my user inputs to php scripts- I choose what is allowed not what to deny which makes it easier. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Cookie References?
Jeff Oien wrote: > > Could you give me some URLs for tutorials related > to cookies and good reference material? www.cookiecentral.com/faq/ has some good general info rfc2109 - more technical but useful http://www.cis.ohio-state.edu/htbin/rfc/rfc2109.html > > One question I have is can a cookie never expire? > Jeff Oien > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Change Password script
enthalpy wrote: > > anyone have example code of a change password script in php? > > <-CoreComm-Internet-Services--http://core.com/-> > (Jon Marshall CoreComm Services Chicago) > ([EMAIL PROTECTED] Systems Engineer II) > ([EMAIL PROTECTED] Network Operations) > <-Enthalpy.orghttp://enthalpy.org/-> > ([EMAIL PROTECTED] The World of Nothing) > <--> > > -- this is for freebsd - use at your own risk - best used as a php shell script run by root $newpassword = "veryinsecure"; $fp = popen("/usr/sbin/pw usermod -n username -h passwd", "w"); fputs($fp, "$newpassword"); pclose($fp) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Pricing for PHP programming???
Shane McBride wrote: > > I know this is not really a PHP question, but it should make for a good thread. :) > > I was wondering what other PHP people charge to write PHP? I have just been given a >project for a fairly large customer, much larger than I normally do work for. So I am >VERY confused.concerned about how to price it. Most of my other PHP projects have >been done for small single owners businesses, and the PHP has been pretty basic. > > Now that I can actually do what I am being asked without have to learn it, I am >stuck. I did a shopping cart for someone, but I didn't charge them a REAL price >because I didn't know how to do it with PHP. So, I of course didn't charge the client >for my learning curve. > > I know the price is very dependant upon the task. What I am doing is creating a >web-based front-end for a MySQL database. I'll need to create the database tables, >etc. The front-end is going to be rather dynamic since the data content depends >largely on the previous choices of the end-user. One or two tables with 20-30 fields. >5-6 pages of html and PHP. > > I'm just scouting this out, and am VERY confident with the contributors to this list >and their opinions. > > TIA, > Shane Just an observation from some people I know in the USA - they charge whatever they can get away with. How about honestly charging what you think you are worth ? Knowing how to use php means nothing - but if you know it well you will be worth a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] solutions to disadvantages when register_globals is off
Dale Robinson wrote: > > Everyone seems to recommend turning off register_globals, but accessing them > through $HTTP_POST_VARS["var_name"], gets tedious. > > I haven't found a better solution (not to say there isn't one) than this > small snippet. > > The idea is to turn off "register_globals", as I believe is heavily > recommended by the PHP team, and declare what variables you are expecting on > a per script basis. > Magic-quotes would also be off. Hopefully this makes all external variables > safe. > > I was hoping some experienced users would cast their eye over this and > suggest any improvements, and comment if it is worth doing at all > > define("ALLOWABLE_HTML_TAGS", ""); > > function use_ext_var($var_name, $var_location) > { > global $$var_name, $$var_location; > > $$var_name = ${$var_location}[$var_name]; > $$var_name = stripslashes($$var_name); > $$var_name = strip_tags($$var_name, ALLOWABLE_HTML_TAGS); > > } > > use_ext_var("sample_var", "HTTP_GET_VARS"); > print $sample_var; > > How are other people handling this, or are most of you 'lazy' and just use > globals :) > > Regards > > D Robinson I was lazy but I've found turning globals off makes code easier to read - If you've got HTTP_GET_VARS , HTTP_POST_VARS and session vars all in one script - knowing where the variables are coming from makes it is easier after coming back to your code months later, or when reading someone elses code. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] ibase_num_fields() -a workaround ?
ibase_num_fields() isn't functional in php 4 - anyone have any ideas to work around this ? I'm checking the number of results for a query to check if a user/password is correct -I suppose I could just do a fetch_row() on the result and test if thats empty or not - but I'll only do that as a last resort -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] i should have been clearer
Slappy Smith wrote: > > >Something along the lines of this?: > > > >"X-Powered-By: PHP/4.0.2-dev Content-type: text/html" > > > >If so, stick this at the top of your script(s): > > > >#!/path/to/php -q > > > >(obviously change the /path/to/php) > > This is my error: > > Warning: Sybase: Server message: Changed database context to 'foobar'. > (severity 10, procedure N/A) in > /home/httpd/html/foobar/foo.php3 on line 11 > If i recall correctly from searching the archives - that warning will always show - just put an @sybase_connect() to supress it -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]