I have an unsigned bigint field in MySQL There will be any problems with php Im not noticing problems but for

so i am first exploding for \n then , or if strstr doesn't find \n's just ,'s

erm

f00li5h,

foreach($one_list as $ip) { if ( in_array( $other_list, $ip) ){ return true; } } return false;
hrm…

it is listed i.e. 10.32.0.0 255.255.0.0
10.33.0.0 255.255.128.0
etc..

http://rafb.net/p/DYNzl554.html

ip2long

file, database, array in php code?

ip2long… ick

which is more efficient for the data i mentioned, the preg or this function? ^^

yea, i'm not understanding what ip2long gives me?
i've looked at it

it gives you a long

try it - but it's possible that preg_split is faster (no loop in php)

convert the 4 bits of the IP to hex, then shift them and & them together

subj, kk thx

this are micro optimisations - don't really nessesary

1.1.1.1 becomes 1 32 & 1 16 & 18 & 1

subj, well i am to be expecting alot of requests

anyways

um… isnt it overkill and unreable ?

if you're worried, leave a comment next to it saying #if this is a bottle neck, try …
what?
that's what ip2long does

think about output caching, bytecode caches, database query caches, …

i will jsut make a flag to switch between those to try later
thanks for th einput

f00li5h, i prefer… ip2long($startRange) … ip2long($endingRange)

it was for explaining, not implementing
personally, i'd just zero pad them, and strip the .'s

subj, only because one part is bound to be a bottlenck that doesn't mean i have to forget about all the other things

:-)

subj, but i realize that with php webhosting it is pretty irrelevant anyways

it only matters when the thing turns out to be a bottle neck

i will see; thanks again

not only php - any language

at least it's not java

replacing fckeditor with tinymce

no000000b

umm, you right tthere?

fap.

n0oooooo

i'm trying to use imap_open() and i keep getting "Login Aborted" in my imap_errors(), the username/password are correct and i've set /notls/imap

bom dia a todos
Good morning
Buenos dias

english please :P

shut up

hello

:O

i have a very strande problem with apache2 / mod_php 4.4.7
the problem is similar to http://bugs.php.net/bug.php?id=41932&edit=3
the problem is similar to a href="http://bugs.php.net/bug.php?id=41932&edit=3"http://bugs.php.net/bug.php?id=41932&edit=3/a
but in my case all scripts using fsockopen eat cpu 100% until max_execution_time kocks the script

a rocket luncher, sounds tasty

a molotov cocktails, sounds very old thing

more high percentage

maybe not
well…i'll work bye!

but anyways can i limit the minimum amount of chars to split my with regex?
like "no string under 4 chars"? without doing a strlen of them all?
hm, would if(str{3}) work?

http://dynom.nl/php/benchmarks/bench.isset-strlen.php

okay sweet thank you
and does regex support something like it?

You can specify the number of chars in the regexp

like?

{2,3}
would be length 2 - 3

in front or after the token?

{3} would be exactly 3

{4,}
would be 4 or more

[a-z]{3}

using {} is deprecated
for strings
not for regexpr ofc
oh nvm me

Dynom, we're talking about regex

I'm on crack

Dynom, ah

care to share?

Dynom, thx i got it :P

haha

[a-z]{4,} groups of 4 or more
though a-z isn't unicode safe these days

ScottMac, i take it {,3} is 3 or less

hi guys… when making a function like this: function &myFunction() - does the & tell the function to return a reference to whatever it may return?

just {3} will do

not sure if that actually works

ah

thats PHP4 syntax

Yes. Return the value by reference

but use \L{3}
err \p{L}

Dynom.. hmm.. and php5? return &$myVar; ?

or \pL but if you have PHP 5 use unicode regular expressions

PHP's compiler does that automatically iirc

makes it easier years later

Return values by ref? I don't think so..

but making a reference to the return of a function is silly

yeah it doesn't save any memory

passing a var with reference makes more sense

PHP uses a copy on write method for variables

Not always… f.x. &getModel() to fetch a class from a Class registry if already loaded, if not, instantiate it, add to class registry and return reference

functionName (&$array) { }

and you'd be messing with scope

you get the idea

yeh, lazy loading ftl

yeah but php web hosting 5 uses references automatically
for objects

ye

so $class = $otherclass; and $class =& $otherclass; are going to end up the same, it might even throw an E_STRICT
different behaviour on PHP 4
but if you're using PHP 4 i'll shoot you

doubt it throws E_STRICT tbh, but you dun need to use it for sure

Waiting for Pollita to jump in and say you're all wrong

maybe in PHP6
proof me wrong, at least I can learn from it then
prove*
god I'm terrible today

http://blog.libssh2.org/index.php?/archives/51-Youre-being-lied-to..html
a href="http://blog.libssh2.org/index.php?/archives/51-Youre-being-lied-to..html"http://blog.libssh2.org/index.php?/archives/51-Youre-being-lied-to..html/a

hm, when i do [,\r\n.]{3,} it doesn't seem to find strings longer than 3 chars :/

At least it's not truely by reference, but it's more so than PHP4

i just said PHP uses copy on write
which is essentially what that is

i love blogs that talk about lies others spread

I'm reading her book now. It's actually pretty good.
If you're interested in learning about PHP internals

i've already read it

Nice

not really; its good enough to know C and beeing able to read the php web hosting source if you really have to

I already have a cvs account :P

htmlentities() in php adds a  to every £ for some reason

It's cool she hangs around in here. Be great if most tech authors were available for a chat

thanks Dynom, headzoo

Rewt`: the reason being utf8 conversions, most likely

so, should use £ for it?

Rewt`: ideally, yes.
then again, you dont want to run £ through htmlentities();

ok, I have an ajax web app. It runs one large php query that can run for several mins. Meanwhile its supposed to run a smaller query every second to 'check up' on it (for a progress bar using session vars). My problem is that (And I Wiresharked to make sure), my browser sends the large query,
and the first check up query. The server processess the large query, responds, and then processess the smaller query. At this point, the browser starts spaming out al

so, perhaps you should review the encoding, maybe do some utf8_encode/decode

Rewt`: check the 3rd param of htmlentities

interesting, thanks. I knew about the first part, but I'm not very into PHP's underlaying code

has anyone here done anything that runs many querys in parallell as such?

so the database queues your queries. You use a wrong table type. How is this PHP-specific?

That's when I turn to Python and threads

no DB involved

then it's a "request", not a "query"

the main php request is running snmp querys

heading to work - bbl

bad idea. Do it in the backend.

i see

you're using sessions?

tlsarles, browsers usually limit the number of concurrent HTTP connections
you're limited to doing X concurrent Ajax calls

correct. In Firefox, the restriction may get rather fascist.

its 8 in Firefox
and only 2 of them can be persistent

Yes… the large request querys say a subnet of hosts. after each host is updates a session var with the % finished. My small querys just ask php for the % to make a status bar
The browser queues multiple of the "check up" requests

I cant be certain. Maybe the browser is queueing your ajax requests; maybe its locking; maybe load balancing in front of the server. More examination is needed.

if you're using sessions the other requests will wait until the first closes the session

I never got why people use(d) create_function()

tlsarles, use Firebug
it can show all browser connections

I wiresharked it… here is whats happening… the browser issues the main query, and the first of the check ups. Then it hangs queuing check ups, untill the server hosting finishes the large request, then spits back the first checkup, and then all the queued
check ups spam out, and get reponded to real fast

I've used it with functions like array_map(), although I supposd that's unnecessary

I use firebug, I like it

makes sense.

the first requests locks the session

yeah if you use standard file sessions you get locking

to communicate over a tcp socket with xml, what does one do?

you might want to replace a session backend

have a xml server?

But firebug was misleading me, as it showed all the check ups being sent at the rate they we're being queued. it wasn't untill i wiresharked that i could see where it was hanging

writes a server and a client?

such as?

you have to save the status outside the session and close it with session_write_close before you start your loop
this way the session is not locked any more

Thats what i was wondering…. when you start session, nothing else can access the session untill the request is done?

write a server, really? not apache or sth?

yes - until the session is closed for the request

hmm…

Dynom, create_function Is useful
its really a matter of code preference though
well coding style

is there a way i can close it at the end of my loop, so it opens and closes constantly in the larger request?

imagine two requests trying to write the session file with different data aut the same time

you can use apache or any web server to relay input to your PHP script, but you said socket.

yeah, i gotcha

I use create_function in places where I want to encapsulate some non reusable code without all these little tiny one liner functions all over the place

yes

kudos. Your solution is more efficient than mine.
!subj++

use session_write_close(), you can use session_start() again in the same script
thanks

oh, exelent. tyty
I'll let you know how it works…

point taken! still I didn't quite get the concept yet.. write a virtual host to point to the script and alle the input gets there?
s/alle/all/

i never tried to start the session again - but it should work, i use session_write_close() in file delivery scripts

going to try that now

Again. You can connect and deliver data via HTTP. In such case you need a web server. You can also do that via plain sockets, in which case you need a daemonized server listening on the socket

thanks! I'll get there eventually..

Why do you use session_write_close(), sorry?

I think you're doing an overkill. Normally there's no legitimate reason to create substandard XML-based services. Standards, technologies and methodologies exist for that.
special case of lock evasion
concurrent access, basically

if you have a requests that opens the session- the session will be locked for all other requests until it closed

Could ya think up an example :P ?

the other requests wait

how would I best go about it then?

so if i am going to send 100 mb files i am closing the session before starting the data delivery

hi all

I dont know the specifics of what you're trying to achieve. In simplest cases, use REST + JSON. Otherwise, use XMLRPC or more complicated cra^H^H^Htechnologies like SOAP
/lastlog

does anyone here use the ioncube php encoder? If so, would you recommend it?

What does 'opening the session' look like in code?

actually, just respond to two nodes of xml, json might be a good bet there..

2 years ago yes - it worked fine, now we are open source :-)
session_start()

oh, you have XML request pre-arranged? Yeah. Makes sense.

hello friends

no, and no. Hiding your code is a dishonest, disgusting practice.
sup

today is a good day, got my own virtual linux box now

i whould not use json but special xml - i can parse that with the browser integrated parser and it is not sourcecode but data (more secure)

Kind of a knee-jerk reaction that one, isn't it? I do open source stuff, but I am also being commissioned to create a product for a client… They're buying the product, not the code.

good point, but no browser involved in the process

and you don't think that's a fundamental problem?

I'm assuming if it worked fine 2 years ago, it should be better now.

Well, Subj, you appear to be correct that the session was locked, I am now getting some of my check up querys to come through! TY

no. Not in the slightest.

Now i gotta work on flow controll… what a mess :-p

here are nice xml-parsers for the most languages

Okay. I dont intend to prescribe anyone's notion of right and wrong.

:-) Don't get me wrong - I'm all for distributing my code when I do open-source stuff, and have done since, ooh, 1992/3. But I also need to make money once in a while.

there used to be a time when the source code was taken for granted, and all software was distributed as source code. Needless to say that most progress in software development as science and art was made during that period.

we are making money with the open source stuff

I have no doubt you're right!

in fact we are kicking out closed source sollutions a lot

are you selling a product to multiple people? Mind me asking what it is? (always eager to learn how others are doing things well )

a CMS :-)

instant $40,000 saved.

how ..fast is include actually? I am thinking wether to break down the website and make tons of templates which am gonna be including into main file and stuff…

is it possible to get some help on this channel regarding php and sessions?

but am gonna be calling include function like 10 times until website building is complete…
sure MaddX

nice
i'm learning php at mo and have a server set up on my own comp localhost and i am having problems reading sessions

which you sell, presumably?

10 times is not much - but you could look for an more complex template system like smarty or crate an output cache for parts and whole pages
it is GPL - we sell projects

i have created a folder eg /temp and can see the sessions appearing when i create them from one page but cant get the next page to read them

sorry for the questions - just trying to understand you model.

subj, people are advicing against templating engines a lot…

for a damn good reason too

i am using xslt - no php based template engine :-)

it just produces an empty session instead collecting the info from the existing one in the folder

people also advice against mixing php and html, but then look how the Zend Framework does its views… Sometimes you've just gotta go with what works for you.

[Zug]MaddX: maybe the session id gets lost

amnuts, i see php as templating system really…

it was

how can that happen?

it still is

only because of the backwards compatibility

well, a bit more than templating system but still :-)

you could create all your application logic as php extensions and use php for templating for example :-)

now now
let's not be creepy

the basic reson for templates is splitting up application logic and layout

subj, xslt? i never looked into this…

if you use php for both, it is easy to mic them up again
mix

xslt, any tutorials on this? i see its like an xml document and stuff…

[Zug]MaddX: It might help to see some of your code

true

[Zug]MaddX: Try http://pastebin.com , and show us what you're doing

try google - you will find a lot of informations

i have
and forums
i am using larry ullman php sql editions 2

basically xslt is a programming language to transform xml trees into outputs (html, xml, text)

can somebody tell me if the pg_transaction_status function works on PHP 5.2?

just try it and see

subj so how do you implement php into all that?

my application logic outputs xml and uses ext/xslt or ext/xsl to transform it to the html/xml/pdf-output
the application logic is of course php

outputs xml? hm, isn't this slowing down everything?

like any template system yes
but the xslt processor is written in c
it is an php extension

i was thinking to include header, footer and body from external files…of course that external file is gonna contain only html

firebug says about 50ms for simple pages here on the dev system

with some variables
title$title/title
and $title is gonna be set in main file…

if the external file contains only html i whould not use include but readfile()
ok still php
:-)

yea but i dont see any advantage that any templating system can give me over this…

think larger

larger? hm, still dont see it

my cms is about 200 loc of php
it outputs quite different xml depending on the plugins used
the xml tree can get really large with a lot of data
xpath is a nice and easy ways to get parts and values of it
makes the formatting really efficent

xpath + xpointer is a gift

those are for creating xml documents?

no for selecting parts of an xml tree
xslt is for transforming a xml tree into other formats (that can be xml but also html or text)
xslt uses xpath for selections

Agavi uses XML configuration with full support to namespaces, xpointer etc. PHP5 is becoming a mature platform.

is it better to use mysql_real_escape_string() or prepared statement to avoid sql injections?

prepared statements are intended for execution of a single query multiple times.

prepared statements

I would like to try to use prepared statements, but I'm not sure that I can use it on my server where I have to upload my website that it is using php 4.3.10

no possible

huh, xsl has its own tagging

not

subj, I guess so too… I did a website using JSP for my university using prepared statements and it worked very good
subj, oh… so can't I use prepared statement in php 4?

doesnt mysqli support prepared statements in 4.3 ?

subj, and so what approach do you suggest? mysql_real_escape_string with magic quotes disabled?

it probably does, but would you honestly recommend anyone to use it?

mysqli ?
or php4 ?

i use a function that wraps mysql_query(), vsprintf() and mysql_real_escape_string()
databaseQueryFmt($sqlStringWithJokers, $parameters, $limit, $offset)
mysqli is php 5

The mysqli extension is designed to work with the version 4.1.3 or above of MySQL. For previous versions, please see the MySQL extension documentation.
ohmm

either one.

its only php5 ?

subj, is this databaseQueryFmt a function that you wrote?

its ages since i used anything else than pdo

*afaik*
yes

well i might recommend mysqli after mysqlnd is out

subj, ok I see … and I guess you have magic quotes disabled, right?

i dont think there is a pdo-mysqlnd driver yet

it loops over $parameters using mysql_real_escape_string and uses vsprintf to put it into the sql
no really i have a function that handles it :-)

OMG, subj its all working properly. TY. I did find though that in cases where you open and close the session many times in one request, you can't have php give any output untill the end, so I had to have all my echos instead store strings as vars to be echo'd at the end of the
file

if enabled

i tried to hack one but PDO was.. hard to get familiar with

it removes the slashes

subj, oh ok I see that. I can do this too, thanks.

You can use the buffer handling to avoid that

subj, is it correct if magic quotes is enabled use stripslashes() ?

yeah that's because ssion_start sets some http headers

Look into http://us3.php.net/manual/en/function.ob-start.php

yes but you have to define an recursive function (with an limit) - $_GET and $_POST can contain arrays

subj, or maybe just I can disable magic quotes on the server, but I don't remember exactly how to do it… I remember that I have to create a .htaccess file, but I'm not sure what to put inside it to disable magic quotes

only in php.ini, httpd.conf, .htaccess
not in your script

subj, yes… I have to use .htaccess because I don't have access to php.ini and to httpd.conf… it is a shared web hosting server

check phpinfo() for the magic_quotes options

php_value magic_quotes_gpc off

subj, I already checked, it is enabled
headzoo, thanks a lot, this is what I wanted
headzoo, can I just have an .htaccess file in my html directory, or should I have one in all its subdirectories too?

Top level directory is good enough

.htaccess is recursive

headzoo, subj, thanks

mmm Red Bull

redbull sux
monster yumm

we've ran out of all the other drinks in the office

Also try 'php_flag' instead of 'php_value'.. if it doesn't work

Red Bull….yikes…not since the last time we had Jager Bombs

mmm red bull
mmm jager bombs
hehe too bad it's 7:40a
here

headzoo, ok thank you, let me check

we've ran out of diet coke, coke, 7-up, Fanta, Rio and Bottled Water
so its down to Red Bull

HEY!
scottie
still on holidays?

yeah

ScottMac, sounds perfect

mmm

rza, found out why builds aren't working from Edin?

in my office we have redbull, san pellegrino, and purified water

no idea

if i include a file in a nother dir, isn't that dir set to relative path for includes?

I've mailed him about a few other issues but nothing

i spent last night debugging null is not null but is null bug

i saw

now i think it is correct
at least its correct by the book
havent been able to reach didou to test it
since this is one of those crashes i have not been able to reproduce

i can make another windows build later to test

yeah, that would be nice

it is relative to the script page

the current constructor is as its should be

use dirname(__FILE__)

not relying on uninitialized values or anything
if it still crashes then there has to be something wrong

headzoo, I tried both of you suggested, but it doesn't work

Apple are doing a release today, I'm so excited

what release?

Here's an example of the kind of function subj was talking about: http://bin.headzoo.com/bin/829

headzoo, I called the file .htaccess and it is in the html dir. I made a little script that just does: if (magic_quotes_gpc () == true) { echo "enabled"; } and I get that it is enabled

rza, New Macs

ah

I never try any of that stuff. I either turn off mq in php.ini, or deal with them in my scripts

i need to shop a mac soon

new iMac and iLife 08 and possibly Mac Mini / Macbook updates

no :-)

my girl has a birthday

headzoo, unfortunately I can't change php.ini on this shared web hosting server

I'm over in Florida start of September so I'll go wild

It doesn't deal with complex arrays, but that's the jist of it

hehe

some software and a new Macbook

it is not in one function

the prices in the states are so much cheaper

yeah, thats true

MacBook is actually good value now a days O_O;

but its not a win for me
they dont sell FI layout laptops there

rza, theres a difference?

Oops.. just realized that % should be %s

I thought Apple had International Keyboards

öåä

those are actually keys?

nope
yes

headzoo, thanks a lot for the function

Who is your hosting provider? Some of them.. like DreamHost, let you specificy your own php.ini, or compile your own PHP

you know what sucks, writing documentation

Hah

I've got 2 more pages to write and then some screenshots

headzoo, I'm in Germany and I'm not very sure about who my hosting provider is … there is already a website there and I am just doing it all new, better

working holiday?

ohh i found an mistake in my function - thanks headzoo

Okay. In the end it's not difficult to deal with MQ in your script
Well, at least I accomplished something today!

rza, yeah one of those you need to get done but you dont need to be in work things

i had return $this-databaseQuery($sql, $max, $offset, $readOnly = TRUE);

headzoo, the only thing I now is that they are not very serious… I sent an email to tell them to enable SSL for the administation page with a self-signed certificate, but they never answered me

to much copy paste :-)

If I have a TO_DAYS(`time`) result from MySQL, how can I convert that into a date ?

i got offered a job in spain

aye. That's not good in a hosting provider

but i dont think they were willing to pay my salary expectation

headzoo, no, it's not good at all

"|blablabla([\w]+[0-9]+/)?([0-9]+)|" … i just want the second arg ( ) but i need the first expression grouped to be modified by "?" .. what can i use instead of ( ) ?

headzoo, I sent a mail in English and in German too, to be sure that they will understand (I don't know German but I let translate the email to a friend) … no answer at all

I imagine your function uses other functions for the array mapping, because you're ready to deal with arrays of arrays

rza, spain would be cool

Never mind ^^

yeah, i was there for a week
i came back last wednesday

i have a loop - i don't like array_map

in barcelona mostly

headzoo, ok thanks for your help… now I see if I can let this .htaccess work, otherwise I will just use stripslashes in my script

rza, I've got a Google recruiter pestering me at the moment

and of course the stripping of the params is a little more complex

do you have a degree already?

rza, what sort of work?

i thought they dont hire without a degree
j2me
or java in general

rza, yeah I came out top of my year

but mostly j2me i think

Personally I wouldn't pass an array to my function. I'd use func_get_args() to pass as many params as I want

and I have half of a masters done

http://bin.headzoo.com/bin/831

ah
i was in uni for two weeks

heh, i did my honours degree for 4 years. That was so boring.

databaseQueryFmt() has two optional params for limit and offset

why would you do that?

then did part of a masters and then cried at the thought of having to do a thesis

that's why the sql parameters are an array

You're ready to deal with a lot of contingencies I see

youre still at vbulletin?

rza, yeah still not sure if I'm ready to leave or not

Because I prefer the syntax of it

my girlfriend just got a new job about 15 miles away

is vbulletin in london?

*g*

its outside London

ah

we are hiring though

mmmm
what kind of salaries?

depends on experience but I think they are at least ¬60,000

hi

that sounds pretty decent
i was ready to go to spain with 50k / year

hi, I have a php function that shows how long users have been connected in seconds… I tried to divide by 60 then divide that by 60 to show how long in hours, but I get .00023 and such. How can I make this show hours/minutes or at least just round off?

it would be relatively large salary there
and i would love spain

rza, its not much in the south of England

mmm

50k isnt much?

my current flat was ¬312k

do you have job posting somewhere?

Owch

rza, I think its gone now but we're still recurting just through other channels.

mmm

Hi

rza, if you want to I can give you the email of the person handling the applications

How long would you say it takes the average person to get up to par at php where one might be able to land such a job?

Do you make cache of database queries?

any ideas?

http://bin.headzoo.com/bin/832

well, would you honestly recommend vbulletin as a working place?

rza, not at the moment

I would love to code for a living, and because I'm rather new would work for around 30k

im supposed to move to california to work but im getting a bit frustrated

Looks pretty clean to me

I've wanted to leave at several points over the last month

the whole process moving from eu to us takes ages

Right now I'm ISP Network admin

Shouldn't this work on a div? onmouseover="this.style.backgroundImage.src='url(img/menu_hover.png)'"

thanks

i wouldn't mind moving to the US too

is there a php channel that help with php issues?

I'm planning to tag along with my girlfriend :P

it is a small abstraction for mysql, mysqli, pgsql and sqlite

i got married just a month ago

she has a Masters in Applied Chemistry
rza, coolio

I did that once… Only had around 12 days vacation a year, which sucks.

did you hvae a honeymoon?

my girl doing masters in philosophy
not really

oh

we're building a commercial application in php, which will be deployed to a large number of computers; thus, we'd like to deploy it in binary form; what kind of options do we have?

i was working mostly

I know a guy who's a Ph. D. in philosophy

SDr, not PHP

wanna guess what's his primary occupation?

i could of course try to hassle you a job once i get there

just in case i still havent got my answers

iconcube encoder, zend encoder

its always easy when you know someone

I must be in the wrong channel…

rza, sounds good Where in CA?
heiths, just ask

south of LA
huntington beach

damn…i really this all this xslt thing is bullshit

You're in the right channel. Just ask your question

think*

rza, vBulletin got bought by a company called Internet Brands last month

where is subj

i was visiting there for a job interview at february
been waiting for a working permit ever since

go Green Card

now is not a good time to go to US

permanent residency

How can I convert seconds into hours/minutes?

subj, any open source solutions?

here :-)

propably not

no

subj, i really think all this is unnecessary….

but its a part of my world tour

there are other simpler ways

heiths - Divide by 60?

no

I divided by 60 then divided that by 60, but I get .000134 etc…

asia

Just divide by 60?

SDr, none really. PHP wasn't meant to be a binary platform

working for a few years in each place

can I make the out put into 2 hours 5 minutes for example?

rza, I'd like to do the same. Just not got the time to sort things out.

question:PHP Warning: PHP Startup: Unable to load dynamic library 'D\PHP\\ext\\php_exif.dll' - The specified module could not be found.\r\n in Unknown on line 0 hwow do i fix this? php5

well if you dont do it when youre young..

I could be wrong, but you'd have to write up a little function to handle that.
Unless something has been added to PHP to handle that

rza, I'm still young. I'm only 22.

-84 ?

nope, it just shows how long users have been connected in seconds

use linux :-p

name any other template system that has implemantations in so many programming languages like xslt and that is an approved standard

Are you sure that dphp\ext\php_exif.dll exists?
One second

subj, i said before…php is great way for doing templates
i am sticking to it

rza, i was born at the very end of 84

well i turn 23 in three days

subj, honestly…whats the difference betwen create an xsl template, doing an xml file and displaying it to web instead of including external php file with bunch of html (template) and some variables?

ah your older than me

it is easier to maintain

i got a friend who is located in england and looking for work

how is it easier to maintain?

rza, PHP work?

php / c programmer

try a variable structure that contains all data in a complex page - say a thread view in forum

Gotta run. But do some googling.. you'll find some functions to do that

i don't do html, my web designers do that part (lets say its like that), i bet they are gonna be more confused with xsl tags than php tags

http://pastebin.ca/648653 , why would php not correctly detect the folders as folder?

and i doubt there is performance boost…

np, thanks for trying

i dont think knowing C alongside never hurts

subj, sure, anything you can structure in xsl you can do it with php variables

rza, true but a language shouldn't matter for a good programmer :P

headzoo:yes im lookin at it

try it :-)

and i dont think statements should be included in xsl

and select data from it

i like his work

well, in templates generally.

Hi, I currently use some PHP coding to generate a .txt log file for downloads, how can I check for mutliple entries within a 10 second timeframe?

what kind of statements?

rza, if he's south of England he can send me a CV / resume and I'll forward it on

I'm using php 5.1.6 and using http://pear.php.net/pepr/pepr-proposal-show.php?id=198 to encode stuff to json-format. Question is, why it encodes stuff to ascii and not to utf8.. and is there a better json encoder that doesn't
break stuff? and also.. how can I decode that ascii (who even uses ascii anymore??) to utf8 ?

Sometimes extensions try to load other dlls themselves, and when they aren't found, php reports that the original dll isn't found

all those that xsl gives you, i saw some like "where", "otherwise"..bla bla

ok

Hi, I currently use some PHP coding to generate a .txt log file for downloads, how can I check for mutliple entries within a 10 second timeframe?

you need that in templates

whats your php.net email?

then they are not templates

because template need to contain the layout logic

scottmac?

they are

no, then php is template…

coloring the lines of an output table is not a part of the application logic

rza, that will do or scott@vbulletin.com

sure it is, how is it not?
statement do not belong in templates
period

ill tell him to send his CV

1 manual page to go

it is a part of the layout because you whoul not color the rss items of the content output

so what do u sugest.btw im a noob i have no idea.

You been at vB a long time… I remember a staffer called Scott from a couple of years ago, at least.

they do

youre fast

I have a weird issues.. echo "TDinput type=\"text\" size=\"12\" name=\"mac\" value=\"{$mac}\"/TD";

jstephenson, I've been there since December 2000

subj, then whats the difference betwen php and templating engine like xslt?
i dont get it…

that's not the question

because xslt cant have db connection? heh..

is printing as input type="text" 0a003e0027cb="" value="" name="mac" size="12"/

Wow … and you're 22 now?

that is the very logic i follow here

well 22 and 8 months

why use something else when i already have it

the question is how do you split beetwenn application and layout logic

So you've been there since 15 :P !?
15/16*

I have a dilemat. I have to display welcome text with subcategories. And is it better to push it to one variable $category_start or push it into a function which would be called in another file?
It must be printed out in another file. $category_start or category_start() would be created before html

hello

and i don't like my template creators have access to eval() or exec() or any kind of php function

jstephenson, 16

so why do you use templates at all?

which is better?

jstephenson, I officially started as a developer in June 2002, worked in support and on vbulletin.org before then

guys, making a function with same name as the class name and using __construct() are the same, right?

yes. nvictor

thanks AlexC_

Wow. You must have been involved from almost the word go?
Jelsoft aren't _that_ ol
d

jstephenson, Jelsoft started in 1997

Orly?

yarly

when does your holidays end?
the guy i was thinking just signed 2 months contract

ends on Sunday, I'm back for 3 weeks then another holiday

ill tell him to talk to you at some point
you can figure things out
i dont feel like applying if you dont recommend the place
btw

rza, only at the moment. It's because we're finishing off projects and we're behind

did you look pdo-mysqlnd any fursther?
further*

rza, PDO isn't fun :P

in general is the job interesting?
yeah i noticed
coded two days straight pdo-mysqlnd
i got as far as executing queries
just the results werent returning well

rza, yeah its fun but we're dealing with a code base thats almost 4 years old :P

lost the stuff

rza, we'll be switching to PHP 5.2+ for the next major version so that will be fun

does it involve traveling?

rza, not enough

Wow… phpBB's site has changed a lot since a year ago…

rza, you get to go to EU conferences if you ask nicely

Anyone know how to get mail() to work simply on windows?

ApacheCon etc
Funky-, setup a SMTP server

i have

I'm going to the PHP con in germany.

it doesn't recieve anything for some reason

don't use CC or BCC

which one?

Funky-, and you configured it in php.ini?

Frankfurt, November

yeah localhost 25

do you have a session?

MikeSeth, Froscon?

i was thinking about making an imagick presentation at some point

a session?
this aint sixties you know.

http://pastebin.ca/648653

i already started it
but it got a little too long

no idea

a talk

rza, I have a GD vs ImageMagick presentation

:-)

i timed the talk and it took over two hours

no. I work for a private gaming company. I doubt they would want me yapping.

maybe some kind of tutorial session would be nice
never held one thou

rza, I have a SQLite 3 native extension partially written
ext/sqlite3

im goin a lil nuts here.i hope someone could help me with this.based on googles

ohh interesting

cool beans
need a hand with that?
ive been out of coding stuff
i coded a taglib extension for reading / writing iudv tags
idv*
but i dont feel like going trough the "release-in-pecl" cycle again
especially not the documenting part

rza, I will definately need a hand at some point. I've got it opening the database and executing queries
urza, I will definately need a hand at some point. I've got it opening the database and executing queries/u
and getting results
I've not yet implemented UDF

how can i call a certain function when theirs an error? i need to call like err_no_command() and not get the normal error printed out

rza, added PHP 6 support to ImageMagick? :P

well, imagick

yeah the wrapper

i looked at it and it shouldnt be hard

http://us.php.net/manual/en/function.set-error-handler.php

just ifdeffing safemode check
and adding some unicode crap

im goin nuts here.i hope someone could help me with this.based on googles ive already tried changing ../../PHP/php5apache2_2.dll in apache conf file,reinstalling php..im just gna reboots brb

as soon as they decide about unicode_semantics

and a if (EG(unicode_semantics))

yes

Want. 5.3. And. Namespaces. Now.

but theres still some discussion about if there will be unicode_semantics
mostly the devs are ranting about it

rza, you mean Jani is scaremongering

jani

hehe

but i have to say i mostly agree with him

hihi

Haha.. I once had an argument with Rasmus about what's PHP best used for. I didnt know who he was at the time.

hhe
the right person to argue with

I majorly pissed him off

Yeah because php is just a template system ;-)
glue code

how can I test if apache server is reading the .htaccess file or it is just ignoring it?

make an error to the file
you should get internal server error

Put some bad code in it, and see if you get a 500 error

headzoo, for example? a line "blah" is bad code?

yep

ok now I try it thanks

I think it's possible for hosting providers to prevent using php_value in an .htaccess, which might explain why it's not working for you

headzoo, it should be like you say, because with a "blah" line I get an error… while I don't get errors with the line to turn off magic quotes…

how can i check if something is a function?…i need to see if $command contains a valid function

do the provider use the mod_php or cgi?

subj, let me check

is_callable($command);

subj, I am looking at phpinfo() … where should I find this information, please?

first section
server api oder somthing like that

CGI/FastCGI

stop confusing me.. :p

ahh yes
try a php.ini with magic_quotes_gpc=off in the script directory

subj, ok thank you, let me try that

but this works only in the directory with the php.ini not in subdirectories if it works

Gah I need to transport a network card… but I have nothing to put it in

hmm is on on|off or 0|1 for magic_quotes_gpc
i am not shure

Hi, how can I make 1 IP view a file only once?

heres my question of error logs.I tried googling and applied a few methods which doesnt work still.Check: http://pastebin.com/d14a6a4db

subj, nothing to do… I try 0 now. Hey, now I paste the script that I use to check magic quotes if you want to take a look at it. I don't want that maybe it works and it is just the script I use to test it

kalve ?

Hi, how can I make a user view a file only once?

with a database, a PHP script, and a lot of hope that your users won't come after you with pitchforks and torches

the phpinfo() shows the current value of magic_quotes_gpc

remind me, are you available for hiring?

you talked to me instead of someone else with a K-nick.. :p

You checked the value of extension_dir, and made sure it's "dphp\ext\" ?

earlier today

where are you hiring
?

subj, ok so I should see it changed in php_info () then, too …

.il

ah

and not me. Friends.

ok

yes

subj, however, should this work?
http://pastebin.ca/648672

.htaccess works only for mod_php, but for cgi php.ini in the script directory can work
yes

that would be in the apache .conf file i assume?

php.ini

subj, there is an extension to allow .htaccess for FCGI / CGI

subj, ok thanks a lot… let me try to change this php.ini with 0, off and all possibilities

for apache or for php?

headzoo:i have 2 of these php.ini . 1 in php folder and 1 in c:/windows . so which one?

for php
subj, http://pecl.php.net/package/htscanner

nice

use phpinfo() to see which one php is reading from

btw

The phpinfo() will show under "Configuration File (php.ini) Path"

subj, nothing to do… I guess I have to contact the assistance and hope that this time they will answer me

have you got time to fix the windows threading bug at some point?

sorry but how do i use that?

i think its the only thing preventing stable release
imho

looks like

Create a script named info.php, and inside put php phpinfo(); ?. Save the file, and view with your browser

rza, I totally forgot what conclusion I'd came to.
Give me a second

sure

subj, I would like to disable this magic quotes, because I don't want that they will mess up with character encoding or similar… I prefer to escape strings myself

ill be right back

headzoo:i cant view local php files.it turns out blank.the html works tho.im not sure what is causing that

need to go home
(finally)

same for me

MikeSeth, pm, please, just for curiosity, but no, i'm hired and very satisfied with my current work place.

i already made the .php accodrin to the installation manuals but oit turns out blank

rza, I think it was a thread safety issue in ImageMagick rather than what we were doing

I'm heading out the door, but if all you're trying to do is get apache/php up and running on Windows, try Xampp, or something similar http://www.apachefriends.org/en/index.html

subj, thanks for all your help and now I will send a mail

but my cms is a product so i have to mess with strange php installations

yes, backtrace suggests that
but its not very elegant just to prevent threading sapis in win

:~~~~(

It installs apache/php/mysql/etc all in one shot.. takes care of everything for you

rza, everything in Windows is built with ZTS enabled

well, almost everything

rza, could hack it on our side and use a mutex when opening jpeg files

theres also non-zts packages

really not elegant though

but you said it happens with png also?

i thought I said it didn't happen with PNG

or do i remember wrong?

so i heard but ive already spent days on these.so i uess i want to figur eout what it is.but thanks for your help anyways

bah, will need to go test it all again tonight

let me read the bug

I'lld use a later version of ImageMagick tonight

subj, oh I see… but anyways, I think that it is stupid that I can't change the php configuration in the .htaccess file. I can understand that I can't change it globally in php.ini file, but I should be able to change it in .htaccess. Now I would like to change host… I don't like this
things… and besides, they don't answer to my emails

I did some further testing on gif and png images and the error occured
on all of them. So it's not limited to jpgs only.
from olivia
so its a threading issue in imagemagick ?
what version of imagemagick is edink using?

a really old one
well oldish

and another issue ive been thinking about

6.2.x i think

since its a static dll

yeah but .htaccess is a part of the apache configuration - so you're not using the php module, apache does not know about the php configuration options

err 6.3.2

how are we going to provide user the ability to configure imagemagick
for example the delegates ?
like path to gs for pdfs
and so on

subj, yes I got the point… anyways, I will try to write to see if they answer

rza, doesn't ImageMagick allow enviromentals to define it?

i dont think they do
maybe its a registry setting in windows?

thats how we do it in GD

i think in linux its a compile time option
where to seek for the xml files

we have some standard directories, a compile time one, an enviromental

types.xml and so on

and it scans backwards

hmm, i need to get into that
at some point

QUESTION:the value of extension_dir,is it supposed to be "dphp\ext\" or "dphp\ext"?

its just annoying that i cant reproduce any of the crashes
not the threading issue or the constructor bug

can php be use with postgresql?

yes

of course

now home -

thanks

hi, is there a way to "convert numbers" to the used locale using gettext? i find alot of infromation about translation but not about numbers

if i include plain html file, file where i call include will just print it out right?

i'd think it would

cool

cjk, number_format will do formatting for the locale

foo mane padme hum

ScottMac, ok, but its not a gettext function, and i need to define the parameters myself?

no it will be parsed and handled as php source
of course a php file can contain only html

hi guys.

hey all

hello

yo

hey

i'm trying to add a function to a joomla component which is php but the function basically creates a .ics file but i don't know how to change the header to a different content type mid-file

How can I use already defined variables in a functions ? it acts like if the variable didn't exist. (i'd like to use a variable set in a config.php files in a function, in another file. Obivously, i include the config.php file in my code.)à

hello

maxownz, you need to use output buffering

have the GD files for win where to put them how to install them and just enalbed the GD2 extension

hi guy's can anyone tell me what would cause this please http://hawksdev.systemcms.com/

Paleo, global $variable; or add it to yout function definition as an arg

Thanks !

looks like your including the function twice porkpie

is that new of php5 , i dont remeber having this "problem" with php4 ?

porkpie, the function is defined twice. go read the file and remove one of the two definitions, or modify it

which file
there are 2
sorry my mistake

hi everyone, is it normal that the $_SERVER['REMOTE_PORT'] get incremented for each page reload ??

only one

rocketmagnet, yeah

it means something in that file is including the function and you're probably including the function also

but how to find out how hight the portnumber can get?
or when it starts at the beginning ?

rocketmagnet, doesn't really matter.. but I'm pretty sure it can get to 65536

and then it starts at ?

depends on the client
it's part of the nature of open-ended one-way connections
they choose the first available local port to connect from

ah ok, but i can use this value to check if the same user tries to load the side a second time

aarcane:I can only see it enter once in the file

why don't you just check by IP?
wouldn't that be easier?

porkpie, check the two lines it mentiones
rocketmagnet, use cookies instead

OK

Alright, in php.ini

i use cookies only for authenticated sessions, for guest users i rely on user_agent,ip,accept-encoding…

i have an SMTP server that requires that I identify myself with a username and password.

and?

When using the mail() function, I can't seem to identify myself to the server.
Is this a problem with the script or php.ini?

rocketmagnet, use a cookie for a non-authenticated session

And how would I remedy this?
….Hello?
does anyone know? _

I don't, I'm sorry

http://ca.php.net/global it should work without "global" .. is that a setting in php.ini ?

hi

aarcane:can't see anything wrong http://pastebin.ca/648714

no, i want cookies only for authenticated sessions for varius reasons
various

why is this syntax wrong? $var='td style="width: 120px"' . echo date("d m Y") . '/td….

aarcane:all I did was dump the db and move the site and db to a dev server that is the same as prod

why do you have an echo in your var?
is that a new line?
$var='td style="width: 120px"' . date("d m Y") . '/td
try that instead

i dont need the echo?

then echo $var

porkpie, it's probably getting included twice.

aarcane:that's going to be hard to find

rocketmagnet, oh well, you can try your way, but there's a good chance it'll fail

shouldn't be porkpie
try commenting out the line where you're getting the error

OK

porkpie, you should use include_once probably

i've played now around 3 days to find a solution that also supports google bots (and they don't have any cookies,also the clients that have cookies disabled)
for a guest user it's not that important

rocketmagnet, look for the user agent for google and give it global access

http://hawksdev.systemcms.com/

looks like there's a problem with that file

:/

that is against the google rules

its probably missing a semicolon or a bracket for a loop

rocketmagnet, lots of websites do it

when you commented the line out
does it have a l
;
or a }
at the end of it?

}

okay
you need to put that back in

I have

hmm
and you're still getting the same problem as before
did you try changing the include statements to include_once?

All I have done is move it from one server to another

yeah, it looks like this server has a different php configuration then your last one

not sure where to set the option ….I didn't write the code ….
php4 and php5
php4 on prod 5 on dev
JadeWOS:where is the include set

in the code
it should say something like
include('filename.php');
you want to change it to
include_once('filename.php');

any mac users here?

lmao, no
sorry
not a mac fan

I am a mac user
Macbook Pro

Anyone know of a way of using file_get_contents with an ssl cert?

and endif; , and an if with a { }

mac users are funny

nothing
just a shortcut way of doing it

I was a PC user a while back …..
JadeWOS:I am struggling to understand where I need to add this statement of include_once??

different ways of doing an if,

porkpie, anywhere you use include, replace it with include_once. anywhere you use require, use require_once

no porkpie, its probably the php config settings on the new server

aarcane:but what file

all of them if need be

porkpie, EVERY GODDAMN FILE

aarcane:there are hundreds

porkpie, so pay a pimply faced youth

lol aarcane
porkpie, ever heard of find and replace??
it works wonders

he
how do I remove spaces from a string?
is there any function for that?

at the end, or middle?

I have a PPC Mac Mini Running Ubuntu

middle

but it would be easier to fix the php.ini would it

strreplace( " ", "", $mystring);

thanks

porkpie, not if you don't know what you're doing
its easier to screw those up then not

JadeWOS:so it's not a simple change in the php.ini

I really hope that apple keeps taking market share

lmao
bad aarcane

tlsarles, I use my PPC Mac Mini as a coaster
it has a coffee siting on it just now

i think you need some time in the timeout corner

haha

hi

tlsarles, though I'm having to resist being a fanboy

Yeah, its just a development server since it can't even run wow

el Jobso is meant to announce new things in 90 minutes

oh, nice

iLife / iWork 08 and a new iMac

I am trying to get the full text of a month by using date, something like date ("F",number_of_month)

I knew it was soon, didn't realize it was today

and maybe some new Mac Minis

tlsarles, now that you can install mac OSX on any PC now… MAC may as well just be another PC

I know I could use my own function but it has to have a way to do it by using this function

Thanks guy's …..I am going to do the find and replace

does anyone know how?

Yeah… I just want to see any non microsoft OS Become standard
I run linux on all my PCs

you could write your own function wfq
function mydate($month)

anyone tried installing GD for php on windows?

then switch on month
and return the string value

GD77, yarp

JadeWOS I know, but it has to bee a way

its php_gd2.dll

there is a way
but you can't just pass in the number of the month

And since Mac has the highest liklyhood of making that happen… and it linux compatible to some degree… that would be great if apple took over

the date function doesn't work like that

tlsarles, mac is just a stripped down BSD

ScottMac guide me man for the love of GOD :/

yep

been trying 3 hours

would mod rewrite be the best way to run all requests through a specific file?

Apple's next OS is offically Unix
http://www.macworld.com/news/2007/08/01/unix03/index.php?lsrc=mwrss
And that is awesome
Oh… and it can serve php… just to stay on topic :-D

tlsarles, windows can serve PHP, so that's irrelevant

yeah, i know…

are intel mac's 64 bit CPUs ?

yes, all current cpus are

hrrm

unfortunately, new computers are still shipping vista 32bit
because 64bit support sucks balls right now

you're a freak sir

GD77 you set your extensions_dir and then uncomment extension=php_gd2.dll

scrpt does not work, while, eg. dokuwiki install does?

yup
those done ScottMac

then you restart apache
or iis

I'm waiting for the next gen AMDs to come out before i get a new server because of the Virtualization support.

gour_, PHP phpinfo(); ?

the GD directories should be in php ext one yes?
apache

!+does not work
!+doesn't work

Look buddy, doesn't work is a strong statement. Does it sit on the couch all day? Does it want more money? Is it on IRC all the time? Please be specific! Examples of what doesn't work tend to help too. Finally, showing us the code is helpful (after you've explained your problem). /msg php-bot
pastebin for more information

damn bot.

php_info(); not showing the GD

lol

GD77, there is no GD directories
there is a single file
php\ext\php_gd2.dll
and a bunch of other extensions

this http://pastebin.ca/648750 str_replace is not removing the spaces

Salut !

thanks a lot. i was hitting my head against wall for quite some time

J'ai besoin d'aide dans la POO

no espekie frenchaie

http://www.php.net/manual/en/function.str-replace.php

les frogois de swampois de lappe de lappe de lappe?

ScottMac bgd.dll compiled from downloaded GD files

JadeWOS, sorry ;-)

logik-bomb, read that page

lol, sorry i couldn't help myself

hello

JadeWOS, you know what's the equivalent to C++ "virtual" ?
JadeWOS, in classes

Whats the most proper way to store database connection info?

GD77, bgd.dll? what the hell is that

DanMan01001, throw it in the database so it's secure ?

for php?

will there be a shorthand syntax for arrays/hashmaps or keyword arguments in PHP6?

GD77, why are you building your own GD?

DanMan01001, put it in a file named "conf.php" which the webserver can't serve.

when u get the GD library and compile form source … those got from google webs

now that i don't know
you can probably find it in the php docs

GD77, GD is bundled into the binary package from php.net

www.php.net
under classes

its a static gd build

aarcane, like just outside of the doc root?

GD77, building libgd and getting bgd.dll is for those wanting to add GD to other applications

the extension is enabled why it s not working then?
oh i see

DanMan01001, sure, or you can use config directives to make it impossible for a user to read it using allow/deny, or whatever

GD77, it explains on http://www.boutell.com/gd/faq.html
under How do i get gd to work with PHP

JadeWOS, i'll see

ScottMac, depends on the distro your server runs

i'm pretty sure there is some equivalent akira

aarcane, he's talking Windows

ScottMac, sorry, I read your statement as a question

JadeWOS, in fact, i would like to call a function in a child class from another function in the mother class

Anyone know if there is a way to use firefox as a sort of proxy? I have certificates for my intranet in ff, and would like to scrape data off the intranet using php

Hello everybody

I have an unsigned bigint field in MySQL. There will be any problems with php? I'm not noticing problems, but for now contains small numbers (it is an id auto-increment primary key). What about when numbers will become very large? Should I worry about this, or will php handle it
correctly?

im new to php and web programming and i have one question
do i have to know graphic design and master it to work in web programming?

nope - I'm terrible at it…

Beshoy, nope, but if you want to go pro, you do need to know someone who does

No, developers and designers are often seperate
The php guy just has to be able to work with the designer. A little CSS wouldn't hurt

yea, cause i see the two things are too hard to learn at the same time

but a good programmer is able to separate the design code from the functional code. this makes it easier when working with a designer

hmm, thats great

beshoy, I would say learn some CSS, its pretty straight forward, and is the easiest way to get your pages looking good without any graphic design

hi

hola\

is that syntax correct?: switch($var) { case ('a' || 'b' }: echo "var equals 'a' or 'b'"; break; }

problem with development/design separation is if you try too hard to separate the two, the page will become slow.

I mean case ('a' || 'b') ?

to, nope
case 'b':

so you need a balance of design and code separation, and performance

okay, many thanks

hi,
what s the diff. btw public_http and www folder on a web server?

fullnick, whatever you want it to be ?

i cant decide where to upload my files

fullnick, try one
then try the other
or ask your server admin (you?)

nope not me
afterwares where should i aplly chmod settings
which folder i mean

fullnick, its probably a symlink
they're probably the same folders

fullnick, I think most of these questions are better left to your hosting provider/admin

ty ScottMac

I haven't deployed a site via ftp in so long :p

hehe ,sorry for noob questions tho,couldnt decide where to ask

CAn phpmyadmin be setup on windows?

yep

Which download is it preferred?
file.

appserv is my personal choice,sets everything itself from scratch

oh really..
only phpmyadmin though, right
?

no, apache+mysql+phpmyadmin

awesome dude

A string is a character array, so why can't I foreach through a string?

a string is not a character array

what gave you that ide
a

???

you can access a string like an array with [$index]
but it isn't an array

I can do $string[1] though and get the second character in that string :P
so why isn't it an array

frankr, that's what I said
but it isn't an array

yeah I hit enter before reading your line

don't confuse the two

its not technically an array? or it really isn't an array
how canI convert a string into an array of individual characters?
can't explode with an empty delimeter..

you can loop through the length though using a for loop using strlen as a stopping point

Web Hosting | Web Host

*
To prove that you're not a bot, enter this code
Anti-Spam Image

Leave a Comment

You must be logged in to post a comment.


Blog Tags:

Similar posts: