guys I have the class Net_DNS working ok in one server and then I moved all to a new server and this class isnt

impleXML; etc.

hi! I have a little problem… I create a function (http://paste.lymas.com.br//?q=6846) and PHP show it messenge error: You have an error in sql syntax; check manual that corresponds your mysql server version for the right syntax to use near ) at
line 1
We can help-me?
sorry my english, I am brazilian

Functions need better names, would it be too slow to do on a enterprise level to encapsulate some in classes to make a easier interface?

does this sound right?
$getweek = “SELECT FROM que WHERE date =’$nextweek’ and date=’$today’”;
to show dates within one week of today

nickelnick, Might want to remove the single quotes
nickelnick, is date a int?

JonathanJooped, I can to do it, no problem
but, is it the problem?

yes

can it access variables using global please ?

date is an int
specified in the sql host db anwyays

nickelnick, then remove the single quotes

int do not require singles?

no

if the int is in sql or if the int is php
or both

nickelnick, no, your doing a integer comparison their, you don’t need them

okay

nickelnick, you also, need to remember that the code your writing if you make it public needs to be properly sanitized and escaped

” . (int) $today;

nickelnick, quick and easy fix to make that safe is type casting to integers

hrm
casting to intergers? what does that mean

usually type casting date to an integer is not wanted

nickelnick, it’s a integer in the database
nickelnick, probably a unix time stamp, so it’s acceptable in that use

why dont you use the database native date format?

nickelnick, php is dynamicly and weakly typed (type is the kind of a variable, bool, int string, etc) casting is a way to change it’s type
rza, hes learning is why I think

seems that I need to recompile php with –mhash enabled, but tried “pear install Net_DNS” at the server host which the class is working and I get the same error, so that’s not the problem (the missing mhash php function, I meant).
any other idea?

can’t you just install the mhash module from you distro?

You mean, from a rpm package or something like that?

yeah, i think it is better to have php maintained by the os – you’ll get security updates when neccesary and not when you remember to think about them

i don’t understand where is the documentation of the reflection class, particularely for the methods
any help please ?

I’ll try to find the centos package and try again the pear install. But it’s really strange, it never happened before this kind of troubles

is_null, http://us2.php.net/manual/en/language.oop5.reflection.php

have you compiled php on your own? there ought to be a php-mhash package

no, just from yum..
php-mhash
I’m gong to try a RHEL one

di you try mhash? or perhaps the mhash module comes with the php packes but is not enabled by default

yeah, I tried lot combinations

i’ve never used centos but mhash is included with fedora

try yum search mhash

yeah nothing found

I found php-mhash.i386 5.2.1-1.fc7 fedora
your on centos?

yes, centos 4
didn’t found it surfing the centos repository either

older one, did you try for a centos 5 rpm?

no, let me check
by the way, check this:

what is the proper syntax for a tags content to remain well formed, even if their is non XHTML content. Do I have to create a XSL, and if I do or dont, would simpleXML handle it…

http://www.bairestools.com/test.php This does work AND this works http://bairestools.dnsba.com/test.php

http://rpm.pbone.net/index.php3/stat/4/idpl/4463663/com/php-mhash-5.1.6-1.el4.centos.x86_64.rpm.html
might need yum install mhash mhash-devel first

I basically need messy etc… tags without closing tags in it..

thats a RPM not source rpm nevermind should be fine

trying to find dependencies..

hir

Tabletdtr/form?

duckhunt… are you the dog or the duck

?

Nintendo… DuckHunt

ya

with the Gun

ya

are you the dog, or the duck?

none
the shooter
Can any1 here help me with a portal?

bah… Id rather be the dog… he always smiles…

lol

I can help with portals

ya?

which one?

um any lol
i just want to make 1

i sitll have no idea what a portal is…

I programmed most of PostNuke

greenjelly vent?

nope

i have 1

note here

ok, installed Net_DNS from pear

hello

note here?

there is postnuke and Zoom.
or… wait

ok so is postnuke good?
all i want is that so when i post in the News part of my forums it gets transferred to my home page

if you dont know what a portal is, goto wiki and read about it

i know what a portal is

duckhunt post nuke has blocks and modules… (which is silly, I was bout to get ride of block/modules and make everything a block…)

im just asking what 1 u prefer

anyways, thats whats coming next for PostNuke…

shoudl I copy now all /usr/share/pear/Net/ some place?

alright
so if i get postnuke u can help me?

lots of people can help you
they got a great forum
look into pagesetter

k well the phpbb ppl werent very helpful
lol

its more complex but its amazingly powerfull

alright cool leme get it real quick k?
ill brb

pagesetter is a module for postnuke

a website with a login button XD

what version of postnuke should i get?

lets you create custom forms, that will force users to follow document standards

latest or stable?

stable

k
so 0.764?

none

?
u dont like postnuke?

it’s one big bug

hehe, duckhunt – cool nick

it works now!

people get confused with postnuke and phpnuke
they dont know the difference

what could be wrong with the other one?

other one?

what is the difference between the 2?

yeah, the other Net package I downloaded, and which works in the other server
I mean, if I download class files, and include them in the script, that’s enough for it to work right?

so if I have a php webhosting script that I’m trying to invoke from the command line…. and I end up getting random Segmentation Faults… what (if *anything*) can I do to troubleshoot that?

duckhunt phpNuke is the original portal… or one of them

guess it will require other pear stuff

oh alright cool
so can i add any template to this?

phpNuke was strictly controlled by one person… and his pride refused to let him take other peoples code
so the project was all of his code
people wanted to contribute so the project forked

ah

the largest of the forks was post NUke

ok i have another question

phpNuke then reversed his licensee of open source, and is charging people for it

thanks for the help

if i have a portal template but it doesnt come with a template for forums how would i do this?

which according to his original GNU license is illegal… but hey whos going to sue over such a crappy product

thank you too

duckhunt, the purpose of portals is to unify the look and feel of a website, to unify its search features, login features, etc…

ya

so your answer is in your question

well ok

if you wanted to build a site like IBM.com or Microsoft.com, you would have to write a portal type application

na i just want a simple site
that has news on the front page
and when ppl post in the news section of the forums it goes on the homepage
thats the main reason i want a portal

\there is just too much information on these large sites to do it without using static info..

glad if it works

duckhunt you might have a better chance with another application… a portal is like a shot gun… have you looked into a blog

b..bad.. crc… *curls up into a ball*

or slashcode (slashdot.net)

well i understand it im just not sure how it works

phpBB has a front page that allows you to add news to the front page
there is also something like doom9.org
www.doom9.org

do you mean something like this? http://eohax.us.to/
oh, ignore the swf =\

has
exactly like that
just where i can have links and then other people can post on homepage whenever
i could even care less if they all look alike
the home page and forums could look completely opposite i just want them to be linked togethor if that makes sense

it would be a 5 minute php script to link them together probably

ya exactly
lol

hiya… any admins around?
trying to figure out why bryanUC got banned… he’s trying to come here for help and gets a banned message

His username includes ‘root’, probably got caught by that catch-all.

ohhhhhh
yeah, rootkiller

i have an easy question

he’s uses that because he killed a box once as root
thanks

how would i array numbers 1-30

Hell, everybody’s done that.

list()

http://php.net/range

range
thats the bummer

thx

any1 know a good place to get portal templates?

function myfunction ($paramn1, $paramn2) {} the second paramn is optional. What i need do to the php understand that the second paramn is optional ?

function myfunction ($paramn1, $paramn2=null) {}
if param2 was left out it will be null

hum.. thanks

hi there, im using php client. how do i read characters from the keyboard?

god I hate writing user interfaces
absolutely hate it

fgets(STDIN); ?

wonderwal, php://input ?

hmmhesays, get something that writes the interface for you; then you will hate scaffolding and yaml/xml

grr, the file begins with over 1mb of nulls _

That’s a lot of nothing.

Does it usually take a long time to upload postnuke?

hiya… me again. bryanUC changed his username to bryanUC so he isn’t caught by having “root” in his username of “rootkiller”

maybe i can learn the avi format and hex my own header XD

he says he still can’t get into #php
do you have to unban him from the channel or something?

hes probably banned

How do I get the filename of the current webpage?

he is… someone suggested it was a generic catch because his username was “rootkiler”

to feed it into filemtime.

so I would like to see if you can unban him if he was indeed caught by some sort of generic autoban

Hmm. Yeah, his DSL block was banned yesterday.

__FILE__ would work for that

Which suggests it probably was him, but we’ll see how it goes.

nah… he’s an admin for the BOINC Riesel Sieve project
I wouldn’t think he would do anything to get banned here

hi there .. any sample to use some webservice? ..

bryanUC himself is a channel admin… I doubt he would do anything here to get banned… so think you could unban him please… he’s got some php issues with APC he’d like to discuss

thanks. But the date I get is wrong, it is today everywhere

oh.. I see… you did it.. thakns

is the timezone set?

thanks mattmcc

maybe no.
I’ll do that first

I apologize for whatever central ohio did

:-)

I’m having a problem with the apc.so extension – and only found 7 unhelpful google results – “Unable to load dynamic libary apc.so – undefined symbol: zend_block_interruptions”
only occurs in Apache, CLI loads it fine

same php version in cli and apache?

yes
looking at the info output, it references all the same config & extensions as well

same version also ?

yes
5.2.1
built 5/20/07 08:09:38

that sounds a bit odd
self compiled apc?

self compiled
pecl was complaining about autoconf not working
so I went the self-compile route

print_r(date_timezone_get(date_create())); gets me DateTimeZone Object (), so I assume it is set.

what is different about PHP being run in apache using suPHP from when it is run by the file’s owner on the command line?

but is it set to your timezone?

things seem to break in the former when they are fine in the latter

can you show me a link to your phpinfo() ?

sure, is PM ok? it’s a friend’s site

specifically, I want to know why “beagle-info –status” doesn’t work through exec() when run from apache

nlaracuente, is beagle-info in the enviroment?
environment*

sorry, how do I check that?

probably; “beagle-info” also runs, but “beagle-info –status” does not

echo date(“r”);

probably; “beagle-info” also runs, but “beagle-info –status” does not

nlaracuente, does –status require a specific user access privilege? what does the error say?

yes, the date is correct

then you screwed up somewhere else

nlaracuente, by not work, does it fail to make some write/read/execute or does it return a error, or?

nothing gets ouputted; sometimes the error code is 1, before I installed suphp it was 134

Ah! I call filemtime in an include.

nlaracuente, sounds like a user/owner problem, see what it’s doing

How do I get the name of the file that it was included froms
-s+?

I agree, but is there any way that I can get more info?

nlaracuente, i’m not sure what beagle-info is, so I would file it, if its not a binary, see what it’s trying to do

like get it to print sdterr or something?

nlaracuente, file `which beagle-info`; vi `which beagle-info` if it’s a asci or something
nlaracuente, if you have access, su to the user executing the php script, and try to run it then

/usr/bin/beagle-info: Bourne-Again shell script text executable

bash script

does it have #!/bin/bash on the first line?

yeah
the script works fine from command line

nlaracuente, from command line su’d as the user running php?

Can one get the name of the file that an include was included by at all, from inside the include?

nlaracuente, the user running php has a shell?

since I’m using suphp, I believe so

nlaracuente, are you a religious man?
(or woman)

the php file belongs to the same user that runs it from the command line

nlaracuente, does this user have a shell?

I’m not sure I understand
in what context must the user have a shell?
the user can log on normally, etc.
and will have a shell in that case

I really don’t want to have to add a line to all the files the site consists of…

do you mean does php create a shell for the user when running the script?
because in that case, I don’t know

nlaracuente, I think you should do a little more testing, like exec a whoami, to be sure who is running the script

whoami returns as expected
also, other commands work fine

okay; then view your env var_dump($_ENV);

and can see the root directory

anything odd?
and if after that, you still have problems, look into beagle-info to see what it is doing

hello

could I use PHP_SELF?

i’m running a script (found here http://pastebin.com/d5da21b51 )
array_multisort(): Argument #1 is expected to be an array or a sort flag in /home/content/m/a/t/mattal4/html/expl0de/includes/pseudo-cron.php on line 258

how would the syntax be?

yeah, apache seems to have messed with some of the variables a bit

could it be because i’m using php 4.3 and this script uses 5

I don’t know how I could make it not do this

you may need to run the script as a different user from within a different environment, once you know the expected environment

oh wow, ok, it completely rewrites env

yep, because it inherits the cgi environment stuff
and from the envi that the php webhosting parser is running in

ok
that makes sense
is there a way to get the CLI env in CGI?

why does filemtime($_SERVER['PHP_SELF']) fail with a stat failure?

or at least retrieve pieces of it

what pieces are of importance?

neo2dot0, i beleive stat()/filemtime() will require +x on those folder

anyone?

hm

I’m not quite sure yet, but I’m guessing that I’ll want my PATH and HOME to be set if I’m running a bash script

Cup, var_dump ($sortarray)

k 1 sec.

the parent folder is uga+x.

is some way by which it can run things in the CLI environment?

cup try putting $sortarray = Array(); before the foreach

php?
suexec

neo2dot0, do you realize what behind $_SERVER['PHP_SELF']; ?

suexec?

hey all, why isnt this working – http://pastebin.ca/652860

I looked that up a while ago
how do I actually run it in a PHP page?

function to check if there is a session started?

php has fastcgi/suexec shit
it’s a apache thing

i just now see that the path is wrong, it is the path the file has locally, on my sshfs mount.
that’s wrong of course.

yeah, I got that much

apache is responsible for setting up the environment

neo2dot0, i assume you already solve it
St3althy, what didnt works ? what error ?

256MB of RAM = no multitasking :9

mod_env might be something you would look into

anyone?

depending how many users use it and etc

isset($_SESSION) will be enough

let’s not be too quick, I was wrong. The path is okay

nlaracuente, if I remember right you can do like, SetEnv VAR value, in your configuration file

thanks

neo2dot0, do you realize difference between “/file.php” and “file.php” ?

yes, I do

yeah, I was hoping there would be a way to dynamically find out what the OS was providing, and load them in from there

neo2dot0, echo $_SERVER['PHP_SELF']; what you saw behind those var ?

var_dump output ’sarray(0) { }’

it doesnt spit it out into a CSV file. I want it to save everything in my db as a csv (columns and rows etc..)

somehow the paths are different. I have /~s307473/sophia/patzig.php, but /home/user3/s307473/public_html/sophia/patzig.php

thanks! I have no error anymore

stat tries on the first one

filemtime(__FILE__);

xmlreader ? (php.net/xmlreader)

that will give me the filemtime of the included footer, but I want the filemtime of the file that includes the footer.

thanks for the help, cstockton

hi there .. who can helpme pls … how to use a webservice …

nlaracuente, feel free if you run into more problems I can give a couple google cycles if needed

you aren’t :P thanks — (i cant /msg cuz i’m not registered )

http://en.wikipedia.org/wiki/Web_service

neo2dot0, sounds like annoying… filemtime(basename($_SERVER['PHP_SELF']));

thk, is_null

let’s see, I try it

how can i say in php “if $var1 isset OR if var2 isset OR … then $varPresent=”true”" – there isn’t an “OR” operator for conditionals… where should I look?

if (isset($var1) OR isset($var2)) $varPresent = true;

why couldn’t i find OR in the function list on php.net?

bkeating, It’s not a function

bkeating, because its not “function”

http://fr3.php.net/manual/en/language.operators.comparison.php maybe this helps

I only get today’s date

anyone know how to export csv file from mysql using php

that will be filemtime of the include, I guess.

this one is taken, too

neo2dot0, you still have another option of file?mtime on php.net
err… file?time

well thanks

now i understand, thanks guys!

lol

yes, fileatime and filectime

hi

last access time and create time.

ive just installed WAMP and cant remember how to set up mysql pass etc… any can recommend an easy detailed page for this?

are you asking about this ? http://en.wikipedia.org/wiki/Comma-separated_values

But I need the last modification time.

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw

ever extended a binary-provided class ?

is_null, what do you think PDO is ?

i never used PDO, it’s a pecl lib isn’t it ?

well… you talking about binary-provided-class (class in binary/compiled form?)

yes, like PDO

Hi! How would I get the number of parameters a method would need ?

or… i failed to understand

Reflection wise.

nope, like you understood at first

with an OO interface

airox, get_func_arg ?

hmm my description is longer

func_get_arg you probably mean, but this is from inside a function
I have an object instance and want to check if the method has like 2 params or not.
Specified in the methods definition offcourse.

Ox41464b – nothing

interreting, in php programming, are they differrent from classes coded in php please ?

Or do I need the Reflection API ?

all i want is to export data into csv

St3althy, what nothing ?

if i do it from phpmyadmin it works well but i want it in my own php file

This isn’t exactly a PHP specific question, but.. Anyone ever seen a table which maps iso country codes to irs country codes? My Google-fu is failing me on finding such a thing, which I can’t believe hasn’t been created before.

i think it’s the simplest

is_null, you can extend them just like any other php written class.

Ok.

thanks cyth

which is why they rock so much

quick easy WAMP config setup + mysql password set….. anyone know one pls?

the way you call them is sexy though

http://todellisuus.net/~mikko/flower.php http://todellisuus.net/~mikko/flower.phps
that extends an internal php class

ok, internal classes have normal behavior, thanks for the tip and demo

airox, headache enough… no idea how to find how many argument that one function could receive

Ox41464b – it didnt work

St3althy, first of all… could you modify your Line:1 of pastebin became: php error_reporting(E_ALL);
St3althy, please repaste and re-run your code after that, also paste what output you saw
St3althy, which part didnt work?
your part ? o_O

anyone have trouble sending an email directly to hotmail’s inbox ?

what is wrong with echo(basename($PHP_SELF)); ?
output is null

$_SERVER['PHP_SELF']

$PHP_SELF is deprecated

neo2dot0, error_reporting(E_ALL); //you will see what error after that

why can’t hotmail be as spam free as gmail and at the same time make it receieve legitimate emails?
what kind of morons are developing in microsoft?

Hotmail relies more on machine learning whereas gmail relies more heavily on user feedback.

users = smater then machine ;p

i think gmail relies on both

….. for now

gmail have better algorithm
to sort out spam

I’m using, $query = mysqli_query, and im trying to find a way to add to $query by .= but then it says i cant add to it because mysqli_query cant be used as a string which i would use later on. Trying to get this to work for a search, any suggestions?

microsoft relies on hamsters

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

hah, PHP_SELF undefined

Microsoft uses Microsoft code

$name = $_POST['name'];

$_SERVER['PHP_SELF']
use that

is this method secure from injection

ok

seriously microsoft is retarded

Hi, i have small arrays. $array1[0] = 23 , $array2[0] = 38, $array3[0] = 0; now, if i do $max = max($array1[0],array2[0],array3[0]); $max = 23; why?!

Bear10, don’t assign query to the return of mysqli_query, first build the string, then pass it to mysqli_query

what dont you understand
o oops

why isn’t max = 38 ?

nevermind

zfdaily, why dont you try to find out why your message treated as spam ?

are you sure all your values are integers?

well, if i echo them out they show as above

that wasn’t what i asked.
var_dump() them

if I do $obj = new Obj(); are there any magic methods that can be used to release recursive references within $obj so that it gets released by php’s garbage collector?

Thumann if your max is uing arrays you will get the highest array value in any of the arrays

gnat42, typically garbage collection won’t be something in a php developers head, are you running into memory leaks of some kind?

yup

gnat42, how so? php is very diligent at freeing unused resources

string(2) “23″ } }

filemtime(basename($_SERVER['PHP_SELF'])) still gets me today, though the filename I get by echo(basename($_SERVER['PHP_SELF'])); is 6th of august by ls -l

the object has recursive references to itself
to make a long story short

aha, so it’s a string value

I’ve created a function that releases those so that it doesn’t leak

what is the best way to take user input from a form ? i have a volunteer signup form, i want to take the form info and send it to a specified email

gnat42, garbage collection is a post runtime event, the zend api should free it

how?
will hotmail tell me their secrets?

$name = $_POST['name']; is this method secure from injection

gnat42, so your concern is rather run-time memory usage?

but I’m wondering if there is a method to get it called automagically
yup

to how they made their spam filter algorithm?

when running the batch, because of the references within the object I had to up my memory limit to 1.2GB to finish the batch

gnat42, unset the objects really

zfdaily, Your sender IP treated as Spam ? (this what im facing previously on Yahoo)

nah
some of my other mails go through fine
just some others

I found the issue, but calling unset on the object doesn’t call any special function

its too hard to find out

it just removes the reference to it in the scope you are currently in

if not impossible

and the object’s __destruct isn’t called because there are other references to the object within the object itself

echo 19 & $role;
echo $_SESSION['user']['userclass'] & 2;
echo $_SESSION['user']['userclass'] & $role;

gnat42, so you are instantiating objects, and then they are becoming to large?

can i convert the string to integer then?

first one is 2, second one also 2, third one is 0
why oh why?

zfdaily, http://whois.sc/your.ip.address and check BlackList Status

no not quite
I have a Record object and Record objects have a Table object within them, table objects hold references to record objects….

hey, the time outputted by ls -l is the same that filemtime gives me of a file?

so $obj = Record();

also, this behaviour differs between the two environments I’m working in

creates an object $obj that holds a reference to a corresponding Table object holding a reference to my original Record object
when I call unset($obj).

gnat42, have you heard of the object pool creational pattern?

the $obj variable is null

var_dump(stat( file ));

nope
where can I read up on that?

gnat42, well, im not sure about php implementation, but it’s a means of recycling your objects, perhaps instead of freeing them, you may pool and reuse
gnat42, Basically what im saying, is once your done with a object of a specific type you could return it to the pool to be reused, instead of working about freeing the resource

I’ll read up on that, but in the mean time there is no magic method that can be used to tell an object that it is requested to die?

destroying alll references will tell zend to destruct
in which case it will call __destruct before it dies
that is for additional clean up

why do you want to destroy the object?

right, but right now to destroy all references I have to call a special function on the object instructing it to clear out its references to itself

how can I get these timestamps in readable format?

that is a application specific task, no function exists

On some pages, the value is correct, on others not. I am puzzled.

neo2dot0, date()

otherwise when I re-assign it a new obj, the resourses it was using don’t get freed

i mean, inside the var_dump

on a webserver, no biggie the script dies eventually and they all go away

neo2dot0, cant… date’ em first

on my batch import script… I need 1GB to get what I need done

that has nothing to do with php really gnat, thats just your specific creational model your using

appears adding (int)($var1) & (int)($var2) soles my problem…

yeah, except I’m using an ORM, and its the ORM causing the issue
so I was hoping there was something

ah

some example code of your problem?

say im want a range of numbers to include the 0 for a 1 digit number

what resources?

how would i do that?

irc://irc.oftc.net:6667

which orm gnat?
inhouse?

$obj = new Object();… memory_get_usage(); $obj = new Object();… memory goes up
no, doctrine, www.phpdoctrine.net
its quite good, very alpha/beta

unset $obj really should do it

cstockton, will not release also

release, what though?

yeah, but unfortunately php doesn’t handle the sub references

that’s a different story

gnat42, i dont think its possible…

I think thats a implementation thing

is there a dev channel for php?

gnat42, those memory didnt being use, but still at usage()

#php-dev?

gnat42, you should unset those in your deconstructor

well I created a function to release the references
and then it worked
the destructor doesn’t get called!

gnat I’m fairly familiar with the php source and no built in function exists, but macros are called on object destruction that free memory
internally by zend though unfortunately
you kind of what some kind of DELETE_OUTSIDE_REFERENCES() type macro
lol

gnat42, there is easy way to test… class foo {__construct(); and __desctruct();}

how can i turn Aug into 8 ? and Dec into 12 ?

I have tested
I loop through and do $obj=new Client();

anyone?

Client has a __destruct function that echos when it is called
all 10 loops happen first

cmon its an easy question!

and memory usage goes up
and then the destructor is called

whats the problem with the memory going up?

what is a good open source project I can look at to model my php programming style after.

because this is in a batch situation and I have to allocate 1GB to the process!

do you have such a high-volume app, that it kills your server?

i’m focusing on a oop approach

why is that object gettiing so big? what do you *do*?

use an array
you don’t understand

snoop-, check out a mvc, singleton, and read php.net/oop5

ok thanks. i’ve read php.net/oop5 i think

phpbb uses over 170 queries in one page view, i think i better optimize it

snoop-, mvc is a good architectural design pattern, singleton is a good creational

the object has a reference to itself, thus when you unset($obj) it only removes your ability to see that object in your current scope
but not the sub references
and php’s garbage collector doesn’t release the actual object even though there is no way to retrieve it anymore
so mem goes up
every new object instance

ok, you create and destroy these objects in a loop?

yes

i never heard of that problem

Ladies and gentlemen
today is a great day
SCO has failed.

which os?

linux
oh?

if (isset($dl_transcript) OR isset($dl_ipodvideo) OR isset($dl_pspvideo) OR isset($dl_mp3) OR isset($dl_vorbis)) { $downloadable = true; }

http://www.groklaw.net/article.php?story=20070810165237718

cool
bout time

damn right

yea it is

formatting via strftime somehow changed the date. A naked echo works fine.
Phew…
I will rather refrain from adapting the date format to german.

How could I work around this problem? http://pastebin.com/m1b76dfc4 I need it to search for all those fields but the only problem is, sometimes certain things arent searched which then cause this to list every entry because it falls under the
search.

Bear10, ill update that bin

i tried it

thanks

memory stays the same

you aren’t using the ORM I’m using

how does the object reference itself?
whats orm?

www.phpdoctrine.net
orm is object relation mapping

did they fix their documentation yet?

i dont want to read into a project or something

makes db abstraction nice and easy

if you have a specific problem with php i will help you

Bear10, http://pastebin.com/mfd5cb55 that is the concept

doctrine? improved a bit yeah, new docs, still not perfect though

make a minimal demo of your problem. tht will help.

Bear10, you will need to make it more logical, like add the or’s, if a where was made yet

I appreciate it, but unfortunately you can’t reproduce it without using this ORM

its an awesome project, but messy and underdocumented

its because of the orm
yeah, single main dev
I have commit access
and help when I can but I’m busy as can be

whoah thats a f*****g crazy loc count for one guy

ah thats what i was trying to do earlier but then encountered a problem but i see what it was now

I think I have my answer on the fact that php doesn’t offer what I need to fix it
yeah he got a SoC project for it this summer
so it jumped forward
it still has issues in my opinion
but it is getting more and more popular

i tried using it, but I needed an ORM for a production project, and it didnt feel right
too fresh

Bear10, cool bear hope you get it working

thus more used and thus somewhat better

you said deleting an object that has a reference to itself causes an error.

not an error

memory leak

it just doesn’t release the memory

prove it

one sec and I’ll paste the code and output

isolation ftw

http://www.hashbin.com/732f.html CODE
http://www.hashbin.com/7335.html output
you can see it goes up each iteration
and _destruct does NOT get called until the end of the script

i doubt that is a minimal example of your topic

if i range(1,31); \
how can i make it not start with 0?

ok, let me do the work for you…

start with 2?

2, 21

gotcah
thanks

lol – unfortunately you don’t have a clue what you are talking about in this instance

range(2, 31)

and I’m not asking for you to do the work

gnat42:
class c { var $bla; function f(&$ff) { $this-bla=$ff; } }
for ($i=0;$i1000;$i++) { $o=new c(); $o-f($c); echo memory_get_usage().”\n”; }

I’ve researched this – AND solved it today

thats what i understand when you say “object that references itself wont release mem”

but only by manually telling the object to release the recursive references

but mem is not going up

range() is always going to start with key 0. numeric arrays always start at 0 unless you implicitly assign values.

let me re-phase that, object which has many sub objects, some of which reference the first object
won’t release memory when ‘deleted’

well.. my way would be to make an exact example. “many sub objects”. how many? 1? 2? 3?
find out what *exactly* the problem is.

I *know* the problem
you don’t get it

whatever

I know where the problem is in the ORM I’m using

what is an “ORM” ?

I’ve even solved it by having it release what it needs to before destruction

old rusty memory?

the *problem* is that I want an automatic way to tell the object to call that function

have one problem where do i stick the or’s?

scroll up, I’ve already explained it
thanks for trying though

how do you search in irssi?

If you need the array keys to start with a certain key use array_combine to join it with another range() of the same length

Bear10, append to every query IF and ONLY IF you already did a query =p
Bear10, did a LIKE rather

not sure i follow :| sorry

Bear10, maybe after $query , set $found = false;
Bear10, ill re edit it

well thing is, that sometimes more then 1 thing is searched so i need the OR not sure if you understand me lol i suck at explaining :

Bear10, ya, 1 sec
Bear10, http://pastebin.com/m10d9c58e

but the second it hits true, it doesnt search the next one does it?

so
how bout them phillies

Bear10, Yes it does
Bear10, You understand what the $_POST['searching_this'] represents right, those are the conditions to be might to search for a specific column within the db

If I have a abstract class with methods defined that aren’t abstract that where fully working. Rather than redefining them is there an official way of removing them for subclasses? Instead of redefining them to make a php error.
or a better way of doing it

JonathanJooped, not sure I understand the question
JonathanJooped, All abstract methods must be defined in sub class

eww, still not working right does a real weird thing

okay well im stuck here trying to figure how to not count the zero in a range90 function

I guess it makes no difference if its abstract or not…. the methods I need to remove arn’t.

i have the if for country before province, and when i search for a province it does the query of country

Bear10, do you understand the structure? print $query at the end to see

yeah, im trying to explain the problem might have to paste sec

JonathanJooped, The very nature of sub classing is inheritance, so if you don’t want to inherit those extra methods perhaps you are using a model that does not work for your specific needs or preference

http://pastebin.com/m664bc966

weeeeeeeeeeeeeeeeeeeeeeeeeeeeee

i replied to your PM

Bear10, each $query you pasted, is using Country LIKE, instead of the relevant column

omg…

So what I was talking about is if there was a way to drop inheritance of a method for a subclass?

lmao, so sorry
cstockton, thanks for all the ehlp

Bear10, No problem

i upload pictures in ‘upload’ folder. how can i forbid direct access to pictures in that folder?

JonathanJooped, so you don’t want them accessible, or don’t want them to exist?

i mean if someone type http://site.com/upload/pic4.jpg he can see it. i’d like to make it impossible.

move the upload directory outside of your public directory

but a php script must have the access to load the pic on the page.

why is php ignoring the php.ini file in the root of my site? I copied the apache php.ini file there, and changed the upload_tmp_dir, but it keeps trying to use the dir in the original php.ini file

jon i answered in pm

iflyhigh, ya could be a solutionx. th
thx

JonathanJooped, to answer your question no, you cannot pick and choose what to inherit and what not too, might want to re-factor, or think about interfaces or something

what if i used something like

$valuey +1)

ok, I’ll ask a different way… is my php.ini file ok being in the same directory as the .php file that does the uploading, or does it need to be somewhere else?

to avoid the id of 1 returning 0
can i do that?

so your not fussed about keys?

nickelnick, cannot assign in that context

use range(1, 32) or range(2, 32) ect

when including a file, does php optimize so that it doesn’t encode functions that don’t get used?

majikman, no, it has to parse it

yea but if i use that range, 2-32 will be the dates showing instead of 1-31
if i used 1, 32 it would list 1-32
but the values would list as 0-31
etc

nickelnick, what is your problem?
nickelnick, if you just need to loop through a count of 1-32, use a for loop

if you need an array starting with 1 going to 32 for both keys and values use array_combine
But I think that’s not the problem… its the logic your using
like cstockton said

if it HAS to be a array, their is range(1, 32), its indexes will be -1, but does it really matter ;p

YEA PROBABLY
it doesnt hav eto be an araray
im just trying to fill the month day and year on a form so i dont have to type each

for($i = 1; $i 33; $i++)

well use a for loop

ok
wow that looks complicated
lol

Is there a way to get the terminal size from php? Such as accessing TIOCGWINSZ

nickelnick, it’s a powerful control structure

i see

can do much more then iterate through numbers

so i is equal to 1, and less than 33;
but add 1
?

Is there a repo with php 5.2.3 for ubuntu?

each time it loops through it adds one by using $i++

http://us.php.net/manual/en/control-structures.for.php

I’m messing with try/throw/catch
and I want to know if I’m using it right
I have a block of code that may return an exception
here’s the code I have…
http://pastebin.sekati.com/?id=TryThrowCatch@87480-3719cb28-t
will this ensure that any error caused by the code will not crash the PHP page?

hey guys, just need a little opinion from you guys, which site do you guys think its better, www.cost.com or www.deals.com or www.specialoffers.com ?

deals.com

action1, no, it will ensure that any error thrown of type Exception will not crash the page

looks ok

action1, if by crash, you mean error out

Yeah, error out
and not complete the rest of the PHP on the page

action1, if you throw new CustomException, it won’t be caught cause it is not of the correct type

well yeah other errors may stop it… but you have caught all exceptions

ok, then out of cost.com and specialoffers.com which do you like better?

JonathanJooped, not all exceptions, just exceptions of type Exception (base php exception class)

cool

no one habla php.ini?

is there a response.buffer=false equivalent for php?

But most exceptions are of that class

or extend it to my knowledge… so are caught

a question regarding database connections. is it advised/possible to maintain your connection variable (returned from say pg_connect) between page requests (like in a session variable) or is it better to just call pg_connect for each page?

thx for the great help

bazz, checkout mysql’s got pconnect

that will chew up the connections… there is a limit on connections and they soon run out. Keeping them connected would really suffer from a doss attack.

action1, ALL exceptions derive from Exception ya

was I right cstockton?

action1, when type comparing for objects base classes are part of the type compared
oops that was to jonathon
ya jonathon

thanks

i’ll just sit and bang my head against the desk while i wait

which will chew up connections? using pconnect, or not using pconnect?

Cool… I had just read the exceptions chapter of a php book haha

JonathanJooped, haha, nice

Correct pconnect can chew up connections, the other side of that story is that most databases have a sleeping connection timeout value, for MySQL the default is 28800 (or something) seconds (8 hours)

JonathanJooped, fundamentally most languages provide a way to catch Exception of type *
JonathanJooped, because of php’s implementation of exceptions the * is type of Exception
python does it’s exception handling a little sexier imo but thats okay I still like php

how can exceptions be sexy

haha

cstockton, I like the way C handles exceptions :-)

in more object orientated languages they are a much more intertwined into the language, and used more commonly

hello, I use the mail() function to send mail, I need the message to be right-to-left instead of ltr, even though it’s plain text (not html) any ideas how to do that?

nod nod, makes sense

can someone help me? i used Notepad++ to write a Hello, World! command, but when i opened it in IE, it didn’t work

maw_, you mean c++?

cstockton, no, I mean C

maw_, exceptions in c would more so be a hack, like macro’d lol

hehe, longjump 3

maw_, 3 setjmp
maw_, I wander if calling c exceptions more elegant then php’s would be a low blow

hehe, it sets my standard

meh

hey guys, so I have a date in the format YYYY-MM-DD, how do I convert it to its timestamp? strtotime seems to think it’s YYYY-DD-MM

Sake, explode it and fix it for strtotime

Sake, as I know it should parse as YYYY-MM-DD. I was using this format and it was working fine

Sake, or explode and mktime

Sake, problem comes in 2007-12-10
how can you determine what it is, you have to assume its a the more standardized counterpart

yea, I just exploded it and it seems to not fix my problem…
oh wait, I’m a dumbass…. nevermind

Sake, explode, and rearrange.. lol

haha, thanks for the heads up

Sake, :P

no, I was doing if( strtotime($d) $now ) print “past”; and then testing with various dates and it was always giving me “FUTURE” instead of “PAST”, but then I realized my year was 2009 instead of 2007.
too much time in front of the PC… that’s for sure

i hear you, im off in 40 minutes can’t wait
not that I don’t enjoy preying on questions like a mad man to keep my sanity…

true that
DOUBLE TRUE!!
I haven’t seen that in a long time. I don’t htink now’s the time though…

hehe
it’s kinda cool some people have very interesting problems

any problems associated with calling an array var ‘title’?

Saberu, no

isn’t it faster to use substr than explode?

Saberu, built in reserved stuff, no

hey im trying to write an account management script for my apache
i’ve established that my etc/passwd file contains usernames etc. but the passwords are represented by x which i’ve been told means they’re located in shadow?

$title = Array();
like that
it doesn’t seem to like it..

what?

JonathanJooped, substring is faster because internally it doesn’t have to create a array to return, but it’s not a feasible solution if you get a date like 10-9-12, then a date of 10-12-12 the extra logic involved to predict it isn’t worth it
Saberu, what do you mean by not like? should be no problem

Well
i just changed the name from $title to $title1
and guess what, it worked!

Samsonn, the passwords are stored in the master password file

cstockton, my problem with PHP is that I’m nothing without pointer algorithms :/

oh right
where do i locate that stockton?
is it in ETC?

Samsonn, well some distros might be elsewhere

well i can pastebin the dir of my ETC folder

Samsonn, don’t do that

how come

Samsonn, on linux /etc/shadow will have the password after username:

yeah i can’t access shadow it seems

Samsonn, on bsd, master.passwd

but i know shadow is existant
http://rafb.net/p/vpTT7s83.html
theres no sensitive data its just a dir of etc

Samsonn, Because php runs as a less privileged user, you need to use sudo or something

sudo?

maw_, I hear you their, but pointers can make your head hurt too

ahh turns out
i was overwriting the title var with a string var

Samsonn, super user do, add apache to a NOPASS sudo exec’r and make sure your apps secure

hmm
dunno if my host will allow me to do that

Samsonn, but typically you should keep the system level and the application level at different layers
Samsonn, If your binding your account management to the system and you don’t have f ull access to it you may want to refactor

i see

Samsonn, Perhaps authenticate against ldap or a database server

limited options then is it

name / passs … that easy

hm
dont think they load the data in a database i can access though
i can only access db’s connected to my data thats it
out of luck?

Samsonn, Never

:o

Samsonn, just better understand your problem domain, and feasible solutions

so far it seems as though there are no feasibles in this case lol

Samsonn, sounds like your environment binds you to something not possible lol, but if you had full access to the server then perhaps it would work

yeah
sucks cause i can read the account details just not the password and i guess not even modify the password later
is there any other files in the DIR listing that could be of use?

Samsonn, I’m not sure what your trying to achieve honestly

Samsonn, what are you trying to do?

make a simple account management script

Samsonn, define account
Samsonn, User account, bank account?

user

Samsonn, Define user

for http

Samsonn, http is a protocol, how is user related

hm guess i got my names mixedup

Samsonn, no, im not being a dick just asking for details ;p

lol yeah
login manager

Samsonn, Okay, so, you want to “Create” the users?

Samsonn, do you mean http authentication?

when i have some sort of server class that is used to produce the html, can i make the hole class static in php5 so there is only one instanz on the server for each user ??

yeah but primarily just edit existing ones

WWW-Authenticate

rocketmagnet, If you mean have a singleton pooled within the apache process no
rocketmagnet, Static classes are just classes that don’t need to be instantiated to have their properties or methods accessed or modified

so i guess theres no way to make shadow read/editable?

k
ty

Samsonn, A account manager, to manage the accounts which exists on the machine itself?

so i must also check when i read the config if the file is_readable because no other process is using it ??

yeah
thats the one

so must loop until it is_readable ????

rocketmagnet, no, everything in php is very stateless, and independent

uff

ah crap it’s one way encrypted

rocketmagnet, the system itself will manage the disk io, it will read it when the disk is ready to serve it

so it’d only be possible to do comparisons

Samsonn, so, you could still UPDATE the pass, and validate it
Samsonn, your approach you may want to take is creating wrappers for passwd and adduser (commands vary across s ystem)

hm

Samsonn, not modifying the files themselves, let the system work the details out

yeah
but no shadow access still. im just reading up on any altneratives

Samsonn, you just need the privileges to run those commands, sudo will help you

sudo

Samsonn, comes default on alot of distros

i doubt i could hook sudo into my host though

Samsonn, is it a shared host?

yeah
shared hosting

Samsonn, How can you have system accounts, and add them etc, without root access? : )

is my syntax for my “isset OR” statements at the top of this script correct? it’s not erroring, but it’s not doing anything either: http://bpk.deepdream.org/downloadable.phps

i dunno

Samsonn, can’t adduser if you don’t have root
Samsonn, lol samsonn, thats funny =p

what about edit user
cause thing is from my hosting i want to offer other people hosting. it is permissable by my host but they dont provide root :/

Samsonn, I see…
Samsonn, thats a big ball game, for a shared host

i’m trying to write a page that contains some javascript and a exec() as the last line. Is there a way to make it show the javascript before running the exec()

yeah

Samsonn, might have to manually add them through the control panel or whatever ur host offers

dont think they offer that feature yet. their control panels pretty underdeveloped

Samsonn, Running a hosting company off 10 dollars is economical but not entirely easy ;p

yeah LOL
you said it

Samsonn, This is a problem you need to work out with yourself :P

lol god
:[

Samsonn, Go buy a VPS, that has plesk

0 as
0 to stop the

lol

0 get

hi

hello

im having a little trouble with destroying my session

0? or
asdf3, whats the problem?

0 which balls it all

asdf3, $_SESSION = Array();

0 post data as

danny, I would fix it at the source, not a hack at a lower level

im using php and mysql, i need to know the id of the last inserted row, thers a function called mysql_ insert_ id but thers no way to make it thread safe right?

danny, fix it on the process page, throw a error, on top of that javascript if it goes with the flow

i have session_destroy(); but for some reason if (!$_SESSION['user'] OR $_SESSION['pass']) is not working, when i destroy, it still seems to be able to make the else true

thats why

0 in the post data though? As there are so many inputs, I don’t really want to add a validation of every input to check for

asdf3, !$_SESSION['user'] if not session[user] (doesnt exists after destroyed)

if it helps, I could post up the processing code

asdf3, That is always true

Hello

if you destroy the variables are still there during the pageload

no the problem is after destroying it still reading as if it does

do this $_SESSION = array(); session_destroy();

cause i check if they dont exist and display login form

if (!$_SESSION['user'] OR $_SESSION['pass']) and this is a bad check
use if ( isset(

Is there a way to remove php from a template file, rename the extension to .html, and the file work correctly?

ill try it

also, is there a easy way to remove php from a file without going island by island

danny, might have to work out the best method for you to check, but I would do it BEFORE the data is inserted, maybe a database trigger if it supports them
soskel, preg_replace

What?
What does that mean
what do I type it into

isset says $var = “”; is set… i want it to be false, how can i do that? or do i need to invert my logic and use empty()?

soskel, $stripped = preg_replace(‘/\?php.*?\?/msi’, file_get_contents(“php file”), ”);

isset with empty string will return true

soskel, something of the sort

what does that do?
and were do I put that?

k. then i should use empty(). thanks

ah, yes you should use empty

soskel, $stripped = preg_replace(‘/\?php.*?\?/msi’, ”, file_get_contents(“php file”));

what is this?

tags with empty string

Were do I put it and what does it do?

soskel, it’s just to help you conceptualize how to solve your problem

wait

moep

is there a way, in notepad++ to strip php ?

sure use a regex
I just gave you a simple one in pcre
Everyone have a good weekend, try not to code to much, code = for bills, life = for fun = )

this is so weird
session_destroy is not working

you have a logic error propably

my log oout page has only this in it PHP session_destroy();
?

php.net/session_destroy
see the example
you propably need

ok my scenario is that I am trying this all on my localhost, is thre something i need to enable?

can i say !empty?

session_start(); session_destroy();
yes you can

sweet!3 php

is it possible to fake $_SERVER['REQUEST_METHOD'] ?
or to give it other values then POST&GET ?

REQUEST?

there might be other values yes

im gonna scrap it and start over
usering the examples

so to be secure i must check all $_SERVER $_COOKIE $_GET and $_POST stuff
?

you need to start session before you can destroy it
logout.php: php session_start(); session_destroy(); $_SESSION = array(); ?
well some of the $_SERVER values come from the server itself
but its not a bad habit to check all external data

i was not corret before: other values than POST|GET|HEAD|PUT ?

i would assume your webserver should barf if its something else

i just wanted to know if it is possible with telnet or other tools to fake some of the $_SERVER values

“unsupported request method”

rm, which value ?

like PHP_SELF
or DOCUMENT_ROOT

i dont think its possible… from outside

DOCUMENT_ROOT comes from the server

Is there something in PHP that’ll parse ctags output?

so i just need to check the header values not set by the server ?
and remove_addr and stuff that is set by the request headers

hey guys
my friend was browsing around facebook and .. it just spit this http://rafb.net/p/3a7T8t28.html

What are you trying to accomplish?

why would it do that?

rm, phpinfo(); thre is Information about this

its just the plain php?
i didnt know php did that at random times

Apache Environment and HTTP Headers Information sections

i look at it from http://at2.php.net/manual/de/reserved.variables.php#reserved.variables.server
ups
sry
there is detailed information on each of the entries

rm, and phpinfo() already seperate those infomation based on which “Client” can fake and which one come from serverSetting

ah ok
so i’ll consult that one

how do you display the contents of an array?
or hash…

var_dump($array);

i tend to prefer print_r() tho

*shrug* To each their own.

the things under “PHP Variables” are set by PHP and “Environment” is set by the server or the request headers
ty for this
hmm… most of the variables from environment are listed under PHP…
so this list is not what i need

Have you mentioned yet what you need?

how do i state a single character in php as opposed to a string?

NoorulIslaam, convert to integer ?

?

are you looking for a typed langauge here?

$a = ‘z’ ?

haha f00li5h :P

a character is just a short string

33

mattmcc so if i do $some_string[$some_index]==’z’ that will work?

Yes.

ok thx

i was searching for a list of $_SERVER fields i can use without any test (set by php not client or header)

array_keys($_SERVER)?

Hi how do i get magicwand support on a debian etch with php5? I installed imagemagick but this did not work. Any tips?

BudgetDedicated, #debian

wow theres people more noob than me here, hehe

Saberu, there always will be

always people above and always people below, thats IT!

1==1

Anyone know of anything in php that’ll parse ctags output?

noone is above or below tho

“1″==1 also

“worth” is just subjective
f00li5h, in php it is

== is the kinda-equals operator, “1″ !== 1 though

but try ‘1′==1 in C :X

you can treat chars as ints in C, if I recall

umm
you can treat them as whatever you want

f00li5h, yes, but ‘1′ != 1 in C

but ‘1′ is not 1 as an int in C
as a pointer even!
hrm

doesn’t guarantee expected behaviour tho

‘1′ gives you the ASCII value for 1

“1″ would be the pointer in C

f00li5h, if you do ‘1′==1 in C, the compiler will translate it into 49==1

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

Comments are closed.