I am trying to cut a paragraph into its sentences using PCRE Right now my regexp only cuts at each full stop exclamation

open, __construct, close, exec, version, last_insert_rowid, load_extension, changes and escape_string

TML, where does the $j += 2 fit into the for loop?

nothing yet, but I'll probably add it on pecl

In place of $j++

ok thanks ill try it

Can you show me the configure string you used? I want to try if that configure-string works.

Actually, I may have misread…what I gave you makes it advance by two steps each iteration

berry__ thanks a million

TML, yeah just realized it isn't working hehe

Maybe some configure options generate conflicts with some other..

If you're trying to format the number, try s/printf

ill try McFly's suggestion
yeah, thanks

TML, if I get time tonight to implement SQLite3_stmt and SQLite3_result then I'll post a sample tomorrow

I'm tired of vb.org Scott.

TML, oh and all names are open to change
WhaLberg, well you've not explained the problem very well

./configure –with-mysql=/usr

you want to find users with a date of X but where are you wanting to find them?

rightnow, cheers.

And then I made sure that /usr/lib/libmysqlclient.so pointed to the client I wanted.

um how could i make check on string if there in string is sth else then a-z and 0-9

php.net/ctype-alnum
Let me know when you're ready to show it to someone else. I'll brush up on the sqlite3 API.

i need [a-z][0-9] - and _

Are you exposing all the constants to php web hosting userland?
php.net/preg-match

TML, not yet
I'm planning a fairly basic version at the moment

I have a mysql-binary package from mysql.com installed under /usr/local/mysql, there is no lib/libmysqlclient.so there. although.. with the CGIs all works well. is the libmysqlclient.so needed for compiling the apache-module-version of php?

so far I can create databases, create tables and do data write queries

Somewhere, I have a perl script I wrote that extracts constants from .h files and preps them for Zend
Is there a libmysqlclient.a ?

yes

And why don't you simply upgrade the system-wide mysql client?

TML, most of the API I've changed to return true / false

Is it possible to get info from the server? (OS, ram, harddrive space, server hosting clock/time and such?)

and the user can then call $sqlite3db-error_msg;

So try –with-mysql=/usr/local/mysql

that is what i tried and that is what not worked.

Throw a design doc in the repo, too.

TML, most of the stuff is up for debate. I'm just really doing some of the grunt work and rza has agreed to help me. We're going to team up on another extension

Well, let's take a step back here. The first thing to check, for your own sanity, is that you're building your php mysql web hosting extension as a shared module.

um would be anyone so nice and make me pattern if i allow only A-Z, a-z, 0-9, -, _

php.net/pcre.pattern.syntax
If we do it for you, how will you learn?

hey everyone

Is it possible to get info from the server? (OS, ram, harddrive space, server clock/time and such?)

Yes.

claesson92, yeah if you have exec / fopen permissions

Ok, so copy the ext/mysql somewhere and remove the php-shipped library so that it can't fall back on that

I run the server myself, so that would be no problems.

claesson92, /proc/cpuinfo is processor stuff and /proc/meminfo

Can i acces this in my php code to echo it?

In theory, sure

some things, yes. Some things, no. Some things, not through PHP.

$string = file_get_contents('/proc/cpuinfo');

Ok, thanks. One more, with the irc/ircg, can i read messages others are writing/sending?

a great exercise to try on Windows!

Theoretically, could I run PHP on windows without installing it?
i.e. By manually configuring httpd.conf and php.ini ?

wtf?

MikeSeth, Windows doesn't count as an OS

?

haha
5] [ScottMac VERSION reply]: xchat 2.6.8-1 Windows XP [Intel Pentium

how are you expecting to use something that is not installed …

but you use Windows Xp ScottMac
hehe

I meant, by using just the .zip files. Instead of running the installer could I unzip the files to a directory and set up httpd.conf and php.ini manually?

srand, yep at Work I do
srand, I use OS X at home
a real mans OS

you'd have to put all the files into the correct directories yes …. but what is the point in this?

mac ?
i want a mac ;~

I want a new Macbook

though, there may be some things the installer does that you just can't do

ahaha…i just want a simple notebook man

hey AlexC_, everyone

here in brazil everthing is very expensive

good morning foutrelis ^^

Hmm, I want to be able to easily keep all my installations up to date.

then just re-install it when a new version is out …

I have +2 computers I want to run PHP on and I want to try something for fun.
Sort of… an experiment.

um what is wrong with this pattern preg_match('[a-zA-z0-9_\-]' , $domain))

A-z

it matches only one letter and the second set is broken
that, and you kinda forgot the delimiters

it should be, EvilDin /[A-Za-z0-9_\-]/

hm now i used /[A-Za-z0-9_\-]/ and for domain "te:st" but i still get true

why shouldn't you?
it matches “te''
in fact, no, it matches “t'' and bails out

maybe you want to check if it only contains those chars, correct?
if so, do /[^A-Za-z0-9_\-]/

perhaps more like #^[a-zA-z0-9_\-]+$#

still

well, A-Z

don't forget the D modifier, whenever you do validation

D modifer?

and you don't need to escape the "-" at this place of the char class

i forget to add character .
how should be added

EvilDin, as in, D modifier, php.net/reference.pcre.pattern.modifiers
#^[a-zA-z0-9_.-]+$#

thanks

with the D modifier, of course

hi, someone know order script?

um what about white space

Why DOLLAR_ENDONLY?

TML, well, according to his description "abb\n" is not a valid string

I see
You seemed to be suggesting it as a general rule, though

yep, I meant that when validating occurs, it's better to start with D and then think of the implications of removing it
few people are aware that $ can also match \n at the end, hence inducing validating issues where it's not expected, like in usernames, passwords etc..

$ would mean same thing with s modifier as well no?

good morning everyone

ekneuss, I knew that after Stefan told me

i need a php script that puts the current date and time into mysql's datetime format
does the date() function do that automatically?

date("Y-m-d H:i:s")

ScottMac, yeah, irrc stephan even wrote about it somewhere

Saberu, can't you use MySQL functions?

Saberu, why don't you simply pass NOW() ?

what I meant

date(format, time) …

XHTML, with minimum format changes?

poncha, mmh ?

I would expect people to trim, then they don't have to worry about it at validation, but *shrug*

i need to compare the current time to the time in the table to see if it's 5 minutes within it

DIY?

tidy

NOW() is *current* time, whereas date() can relate to any timestamp in unix epoch

AlexC_ yuke
TML tidy? cool… Ill look into it

TML, yeah, but we all know what occurs when we expect things from people, don't we
poncha, sure, he's talking about the current date, though.

Well, that's why I didn't disagree with you so much as try to understand your reasoning.

i'm working on this content management system, and i got some dropdowns that present a hierarchy.. is there some non-js way to make them dependant of eachother without losing other form data, etc?
just looking for a clean way to make dependant form elements in php

NOW() - INTERVAL 5 minute

you can do most of it in SQL

yeh i realised i can do it all in sql
is it possible i can do it in sql host then return a 0 or 1 value?
to show true or false
i know this is possible
just not sure how

use an IF

if it returns any rows then its 1 else its 0

control flow statements on mysql.com
why not check that with mysql_num_rows ?

ah yeh thats right silly me
it will just only return rows it's true on
which is what i need

Where can I get the hostname of the current machine using a non-cgi version of php?

how can I show the result of a query which has been used GROUP_CONCAT within?

$host=getenv("HTTP_HOST");

WhaLberg, you can use GROUP_CONCAT(username) AS usernames then you'll find it in $print['usernames']

if i make a new object, does it garbage collect at the end

rook2pawn, yep

this is for a cli php script, not through apache

rook2pawn, at request shutdown you get __destruct or when it goes out of scope and the refcount is 0

so $GLOBALS['sql'] = new mysqli( DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE) will clean itself and i dont have to disconnect either?
how would i close a mysqli connection?

search close

better yet, why would you open it in the first place

-close()
Hmm?

beanz, getenv("HOSTNAME"); for CLI if no-one answerwd you

$host=`hostname`;

eww backtick

mysqli is like sticking it halfway in
its not exactly mysql_* api and its not exactly PDO

O.o

why eww? same as shell_exec )

poncha, but its an enviromental variable why spawn another process?

looks like HOSTNAME isn't set on dapper :/

Works somehow.. thanks.

file_get_contents('/etc/hostname');

What's wrong with my MySQL syntax it's not inserting the date, $query = "INSERT INTO quote (`q_user`,`q_quote`,`q_date`) VALUES ('{$data-nick}','{$nquote}', '".date('Y-d-m')."')";

it is exactly mysql AB API

why come to ##php for MySQL syntax error
#mysql is there for a reason,

None of this is my decision. I'd rather be working in perl dbi

thanks though

sad face :-/

bool(false)

that too, but hostname may give fqdn as well with -f

php -r 'var_dump(getenv("HOSTNAME"));
string(21) "DevNull.Jelsoft.Local"
even

is your php linked to php-cgi?

which php ?

root@DevNull [/home/scott/sqlite3] # php -v
PHP 5.2.4RC1-dev (cli) (built: Aug 13 2007 11:25:10)

WhaLberg you find your answer?

mine is 5.2.0-8-etch7 (guess what os )

evil debian?

when you use GROUP_CONCAT you usually create an alias, i.e GROUP_CONCAT(field) AS my_concat_field, then you can access my_concat_field later in php

not evil at all
btw it may be dependant how you are logged on
i am there over ssh on pts/0
on tty you might get other env

hi

hI
question
i have a website template in HTML which requires i replace certain things

or php echo $VAR; ?

make the file a .php file (rename it) then just do php echo $var; ?

HAHAHAHAHAHA
http://www.google.co.il/search?q=scox&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

i *can't*. i want a full website with a faq, index page, all that jazz, and here i'm mired in a small loss

FAIL.

short tags (= ?) are not considered as portable, many servers have them disabled by default.

i want this index page to have a menu with FAQ and home page in it

then make it so it does?
I don't understand what you are asking

clarification requested. Why does "return $res[0]" return elements $res[0], $res[1], etc as sub indicies of $res[0] shouldn't it be "return $res[1] if thats what I want?

but i want the FAQ to be generated dynamically, and i want links to the FAQ and home page from within the index page
that is where i am confusedf
i dont want to seperate HTML and PHP
because i don't need to
i don't want two php pages, just to be clear
if at all possible, i want only one
so can you please help?

?

I can't sorry, I have to go
bye

the 1 refers to the index not the amount of levels

everyone please help me
if you want i can provide full details

stop pressing [enter] all the time

ok welll look at http://fswh.ath.cx. it is made from a HTML template, okay. and i would like to put in a FAQ page. but i want a menu on the left side and a link to the FAQ page. the problem is how to put that in the PHP page (after I rename) without seperating
the PHP and the HTML.

hi

http://rafb.net/p/IDvBxX57.html is the HTML template
so, can someone please help me out?

Mace[work]: so if there were more rows in $res then I might pull from $res[3] and get the indexs below that. I think I just got it. Right?

Is there a way to find out which php file defined certain variable (I have an array but have no idea where it is defined (I use the one variable name to temporary store some data and then I empty it, this time i forgot to empty it))

uh oh…. Apache Webserver keeps crashing when I open a .php page…

What's the best way to 'verify' the existence of text in a string? For example, string "hello world" if I want to boolean verify that 'hello' is in that string, how would i do that? Thanks for any help.

Help me please someone.

anyone have a clue how to fix this?

not the indexes below per se, the indexes inside. so $res[3] would reference whatever is stored in $res[3]
the 3 represents a position in the array

syntax for starting a php 4.X class?

new Foo()

writing a xlass sorry
nm
This requires more then a simple answer

GreenJelly, explain the questions better and you'll get a more complete answer
class Foo { var $moo; function bah() { echo 'test'; } }

how can i guarantee the enumeration order of a key=value array by foreach?

arsort ?

enumeration order?

I'd say you'd be better off if you found a way to make the code behave correctly regardless of order

if i do something like $a = array("2"="value", "0"="value2", "1"="value3"), i would like to get it back in a foreach in the original order when i set it
and not in by-key sorted order

ScottMac I retract my question, do to the complexity of the issue, and the fact that I need to read documentation.

use associative arrays?

ok

dog bless you. I wish everyone had brains like you do.

Mace[work], isn't it associative?

$keys = array(2,0,1); foreach($keys as $key) { /* $other_array[$key] */ }

it's re-arranging because they are numerically indexed, if you did array('one'=… that would be associative

ScottMac sorry I bothered you guys…. I like asking questions with one word… like Q:"what is the command for making a choice between two variable possibilities" A:
"an if statement"

if only life was the simple

:-D

Mace[work], but i gave strings as keys, not numbers

$keys = array(2,0,1); foreach($keys as $key) { /* $other_array[$key] */ }

php typecasts automatically so even as strings they are numerically indexed

how do I add extensions?

TML, it's too complicated for a 300-elements array

TML they are all varients in nature (kinda)

zpertee, sorry, my magic ball doesn't work. What OS, what extension?

Mace[work], hm… then, i will swap the values and keys

Mace[work]: I guess what I am trying to get clear on is my debugger shows an array $res. in that array is an array [0] and in that

sorry pdani_ they are all varients in nature (kinda)

Mace[work]: is [0], [1], etc.

berry__, sorry. wasn't sure how much info you needed. I'm using ubuntu 7.0.4 with php5 and I need to add the session extension.

GreenJelly, i see

do echo "pre";var_dump($arr);echo "/pre"; and pastebin the results so i can see what you're thinking of

pdani_ the variables convert themselves like variants… not sure if they are stored as varients… that is an interesting question
pdani_ PHP is a high level programming language… definately not a low level… it does allot of the stuff for you…

in this case the variable you are reffering to is an internal pointer and yes they are stored in the typecasted format (presuming by varient you mean a value that could be used in more than one context)

pdani_ becarefull though… SQL injects and HTML injects… if someone inserts a redirect statement into a variable that will be placed on the page, they can redirect them to their site, and spoof the user

zpertee, I really don't know Ubuntu that well, but I'm guessing Google might help

Mace[work] A variant is a undefined variable. It can be any type of variable, and used in any way… though printing certain data can get funky. In lower level languages, variants are often provided, but discouraged because they are slow and unsafe. In lower level languages you have to (or
should) define all of your variables… I would even define all of my variables in PHP, but I can…

….change their usage without much problems… Varients can change forms. They can be integers one moment, and then strings the next.

berry__, ok

Mace[work] you can add a variable to a string without any conversions…

I am not obtaining to install the library ssh2 of the pollita.
http://paste-bin.com/12230

How do I access private static variables from public static functions? Can I? Do I use "

 Java 6 Web Hosting | Java 6 Hosting

*
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: