[PHP] Re: How can I get all vars

2003-07-02 Thread sven
get_defined_vars (); ?

Slava wrote:
> Hi,
> Can somebody say how can I get all vars and their values from a
> script.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] string modification

2003-07-03 Thread sven
hi,

i didn't find a function for this in the manual, but maybe there is one (or
a workaround):

does anyone have a solution for replacing multiple whitespaces with a single
whitespace whitin a string? similar to trim(). maybe a regular expression?

eg:
$string = 'word1   word2 word3';
$modified = 'word1 word2 word3';



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] string modification

2003-07-03 Thread sven
thanks, this works.
ciao SVEN

Leif K-Brooks wrote:
>> hi,
>>
>> i didn't find a function for this in the manual, but maybe there is
>> one (or a workaround):
>>
>> does anyone have a solution for replacing multiple whitespaces with
>> a single whitespace whitin a string? similar to trim(). maybe a
>> regular expression?
>>
>> eg:
>> $string = 'word1   word2 word3';
>>
> $modified = preg_replace('|(\\s)+|','$1',$string);
>
>> $modified = 'word1 word2 word3';



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: mail + regex + somethoughts

2003-07-03 Thread sven
maybe you dig a little bit deeper:

take a look at rfc2045 and following. they describe the mime-type. there is
also specified, how boundaries in multipart-messages are defined.

ciao SVEN

- Edwin - wrote:
> Hello,
>
> "Shivanischal A" <[EMAIL PROTECTED]> wrote:
>
>> Hi Edwin,
>>
>> Let me restate my question...
>>
>> I'm now replying to ur mail. I've left ur message to me untouched.
>> (whatever follows '- Original Message - '). What i want is
>> that some SERVER-SIDE SCRIPT should be able to identify these
>> original messages and remove them before storing the actual
>> responses.
>
> Hmm... I'm not really sure if I understand this but...
> First, NOT all "mail clients" will add this:
>
>   - Original Message -
>
> to the original message. Besides, there are many ways how each
> individual would quote the original message. So, writing a script
> that would identify THE original messages would be, IMHO, next to
> impossible...
>
> What is the purpose anyway?
>
> - E -
>
> ...[snip]...
> __
> Do You Yahoo!?
> Yahoo! BB is Broadband by Yahoo!
> http://bb.yahoo.co.jp/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Connect Active Directory using LDAP... please help :)

2003-07-03 Thread sven
hi vince,

Vince C wrote:
>  $ldaphost= "company.com";
>
> if(!($ldap = ldap_connect($ldaphost,389))){
>  die("ldap server cannot be reached");
> } else {
>  $oudc = " dc=company, dc=com";
>  $dn2 = "";
>  $password = "";

did you define your user and password? afaik win ad isn't searchable by
anonymous.
ciao SVEN

>  echo "Connected and ready to bind...";
>  if (!($res = @ldap_bind($ldap, $dn2, $password))) {
>   print(ldap_error($ldap) . "");
>   die ("Could not bind the $dn2");
>   echo "Couldn't bind ";
>  } else {
>   echo "Binded and Ready to search";
>   echo "LDAP = $ldap";
>   echo "oudc = $oudc";
>
>  //
>  $filter="(&(objectClass=user)(objectCategory=person)(|(sn=sorg)))";
>   $filter= "sn=*"; $sr=ldap_search($ldap,$oudc,$filter);
>   echo "number of entries found: " . ldap_count_entries($ldap,
> $sr) . "";
>   echo "filter = $filter";
>   echo "sr=$sr";
>
>   if (!$sr) {
>die("search failed\n");
>   } else {
>echo " Searched and ready for get entries.";
>$info= ldap_get_entries($ldap, $sr);
>
>for ($i=0; $i<$info["count"]; $i++) {
> print ("");
> print ("" . $info[$i]["cn"][0] . " " .
> $info[$i]["sn"][0] . "");
> print ("" . $info[$i]["mail"][0] . "");
> print ("");
> print "In the display FOR loop";
>}
>echo " After loop.";
>   }
>  }
>  ldap_unbind($ldap);
>  echo "LDAP unbinded";
> }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: mail() - how to attach file to the message???

2003-07-09 Thread sven
do you want to send a file via mail (mime-type of the file?) or do you want to attach 
the file to a mail (multipart?)?

the mail-format is defined in rfc2045 and following. but if you don't want to build 
your own function, there are good mime-mail-classes out there. (e.g. 
http://www.phpguru.org/mime.mail.html)

ciao SVEN
  "Szparag" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
i know that in mail-form i need 

but i don't know how to write message headers to send file with e-mail.

please help me.

szparag. 
   
   
  
IncrediMail - Email has finally evolved - Click Here

[PHP] Re: SQL select

2003-07-10 Thread sven
hi,

JiøîÆèî eË wrote:
> hello,
>
> i have got a problem with SQL select:
>
> I have got a table such this:
>
> id_k typ name id
>  1   f   bla1   1
>  2   f   bla2   1
>  2   i   bla3   1
>  3   z   bla4   1
>  3   f   bla5   1
>  4   i   bla6   1
>  4   z   bla7   1
>  5   z   bla8   1
>
> and id = 1 and I need select these rows:
>
> id_k  typ nazev id
>  1 f   bla1  1
>  2 f   bla2  1
>  3 f   bla5  1
>  4 i   bla6  1
>
> so, when doesn'i exist component (id_k = component) type "f" so I want
> component with type "i", but when doesn't exist type "f" noir "i" I
> don't want to select row with type "z".
>
> jiri nemec, ICQ: 114651500
> www.menea.cz - www stránky a aplikace

don't know, if i correctly understood, but how about this:

SELECT * FROM `YourTable`
WHERE `typ`="f" OR `typ`="i"
ODER BY `typ`;



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: too stupid to install php on windows

2003-07-10 Thread sven
hi,

Johannes Reichardt wrote:
> Hi there!
>
> I had a perfectly working installation of apache 1.23 and php4.12  -
> unfortunatly i got heavy problems with the mail()
> function that didnt seem to like my subjects and froms. anyway - i
> just de-installed apache and php and reinstalled the
> most recent versions (apache 1.27 and php 4.32) - i followed the very
> same way like always while installing:
>
> but i fail. i can´t start apache with php, actually i do not get any
> meaningful errormessage (the only thing is NET HELPMSG 3534)

the only thing i found for this:

Z:\>net helpmsg 3534

Der Dienst hat keinen Fehler gemeldet.


ERLÄUTERUNG

Der Dienst hat keinen Fehler angezeigt.

MASSNAHME

Versuchen Sie es später erneut. Falls das Problem weiter besteht, wenden Sie
sich an den Netzwerkadministrator.

sorry, i got a german windows version. shouldn't be the problem for you (mit
freundlichen grüßen) ;-) anyway, the input at the commandline should bring a
result.

but i think your service didn't start correctly, but also didn't return an
error. does your apache start without php? just comment the lines in
httpd.conf.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Get previous folder

2003-07-10 Thread sven
... and what about dirname()?

Matt Palermo wrote:
> Anyone know how I can stip off the end of a folder location, so that
> it will be a folder in the next level up?  I want to turn something
> like this:
>
> /path/to/folder/MyFolder/
>
> into somthing like this:
>
> /path/to/folder/
>
> I just need to strip off the last folder and that is it.  Can anyone
> help me out?  I appreciate it.  Thanks.
>
> Matt



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Regex nightmare:(

2003-07-10 Thread sven
Tim Steele wrote:
> i need to uses reg ex to change  to  target=_blank>
>
> the < brackets have to be represented using < and >
>
> I have tried so many ways, but none work. here is an example of my
> faliure.
>
> $body =
> preg_replace("/(href=\/?)(\w+)(>\/?)/e","'\\1'.'\\2'./'target=_blank/
> '.'\\3'", $body);
>
> Thanks

did i understand you correct? you search in real html-code (with '<' and
'>') and want to replace them later by '<' and '>'?

- if so, your regex can't find any >. either you search for an '>' or you
use htmlspecialchars() or htmlentities() to convert these brackets before.
- also, if in your href="" stands a full url (with
://.) your '\w' doesn't work
- what are the optonal escaped slashes for? '\/?'

hope this helps for your start:
$body = 'http://www.url";>';
$body = preg_replace ('/(<)(a href="[^"]+")(>)/', '<\\2
target="_blank">', $body);
var_export($body);

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] isset function problem

2003-07-10 Thread sven
... or:

if(!empty($SenderEmailAddress))
{
...
}

Dean E. Weimer wrote:
> What about the rest of the code?  How is this variable defined?  I
> have had this happen in some code before, I found that the variable
> was set to "".  Try using:
>
> if (isset($SenderEmailAddress) && $SenderEmailAddress != "") {
>   mail($mailTo, $mailSubject, $Message);
> }
>
>> I have the following code :
>>
>> Quote:
>>
>> if (isset($SenderEmailAddress)){
>>   mail($mailTo, $mailSubject, $Message);
>>   }
>>
>> Unquote
>>
>> All I want to do is that , if the $SenderEmailAddress is not
>> entered, the mail() function should not run. However,
>> if the $senderEmailAddress variable is not set, the error I get is
>> "No recipient addresses found in header "
>>
>> Can someone help and tell me why I get this error?
>>
>> Thanks
>> Denis
>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Storing HTML string in database

2003-07-11 Thread sven
is escaping a solution?
addslashes() for your insert-query
stripslashes() for your select-query

"Aaron Axelsen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
>
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> I have a php script set up for a user to upload a word document,
> which is then coverted to html form, which I would then lke to store
> in a database.
>
> Howver, when I run the following command:
>
> INSERT into sermons (data) VALUE ('$output');
>
> It failes to work, because the $output strings contains "", which
> messes things up.  Is there some way that this can be ignored while
> entering into the databse?
>
> Or am I better of replace all the "" with ''?
>
> Thanks for the assistance.
>
> - ---
> Aaron Axelsen
> AIM: AAAK2
> Email: [EMAIL PROTECTED]
>
> Want reliable web hosting at affordable prices?
> www.modevia.com
>
> Web Dev/Design Community/Zine
> www.developercube.com
>
>
> -BEGIN PGP SIGNATURE-
> Version: PGPfreeware 7.0.3 for non-commercial use 
>
> iQA/AwUBPw4PI7rnDjSLw9ADEQLL5QCg6rxSs/roIiGyxC6nN3XNiuONg00AoK/T
> PSAAAbM+O7+e6iVNMMnpK5AC
> =phqJ
> -END PGP SIGNATURE-
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Using a drop down box with an udetermined field amount

2003-07-15 Thread sven
hi ron,

there are 2 steps to do this:

1. get data from mysql
   (you can use 'group by' in your select-query for doubles, maybe some kind
of sort)
2. create your ''
   for each mysql-row create your '$var2'
   (if you like, add some logic for 'selected')
   close you ''

ciao SVEN


Ron Allen wrote:
> What I want to do:
> Have a person input information about individuals into a database.
> One of the fields in the database will be Unit.
> On a form one of my drop down menu's will be Unit.  I would like to
> have the PHP page poll the Unit field in the database and send all
> the different Unit results to the drop down box.
>
> Unit:
>
> This would be an example of the information that would be an entered
> H Co
> H Co
> B Co
> A Co
> K Co
>
> This should be the results
> H Co
> B Co
> A Co
> K Co
>
> Any help would be appreciated!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: pdf information..

2003-07-16 Thread sven
a pdf-page can have almost every format you want.

originally you work with postscript-dots, where 72 dots are 1 inch. it's
easy from that point to calculate from metric system, where 1 inch is 2.54
cm or 25.4 mm.

with this in mind you can exactly define the height and width of your
pdf-page. i suggest you use one of the ready-made pdf-php-classes.

ciao SVEN

"Louie Miranda" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hello,
>
> I have been given a task to generate a business card program over the web.
> The option that i can think of it to make it easier is generate a pdf
based
> on the user's experience over my preview program on the web.
>
> Now im wondering does pdf have those image resolution size? I mean on
image
> you can specify 100x100 pixels and make the resolution into 300dpi. How
> about pdf?
>
> --
> Thank you,
> Louie Miranda ([EMAIL PROTECTED])
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: multi file multi colomn

2003-07-16 Thread sven
can you more clearly explain your problem?

- do your files contain of many lines and you want this:
f1l1;f2l1;f3l1; ...
f1l2;f2l2;f3l2; ...
(f=file, l=line)

- or do you simply want the complete content of the files separated by
semicolon?

ciao SVEN


"Fb" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I have 40 text files.. each files have 1 colomn of a data. I want to write
a
> script to merge them like
>
> datafrom1;datafrom2;datafrom3;datafrom40
>
> how can I do that?
>
> TIA
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Mail From option in PHP.ini

2003-07-18 Thread sven
... and how about this?
$headers .= "Return-Path: $email_address_from_your_database\r\n";
tell me, if it works.

ciao SVEN


Brian S. Drexler wrote:
> I tried the extra header.  The problem is with the return receipts.
> The mail is being generated by a server other than my main e-mail
> server, so if I want a delivery/read receipt I have to specify a
> "From" e-mail address or else it will default to the user executing
> the script, i.e. [EMAIL PROTECTED]  ini_set() does not appear to
> work with sendmail_path. sendmail_path is in the PHP_INI_SYSTEM group
> so it can only be set in the php.ini or httpd.conf...Thanks for the
> suggestion though...
>
> -Original Message-
> From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 18, 2003 11:09 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Mail From option in PHP.ini
>
>
>> Ok, I want to specify who the mail is coming from by using the
>> sendmail_path option in the PHP.ini.  I've added the
>> [EMAIL PROTECTED] to it, but I want to be able to dynmaically change
>> [EMAIL PROTECTED] to [EMAIL PROTECTED] or whatever else.  Anyone have
>> any ideas how I can do this?  I'm pulling the e-mail I'd like to
>> change it to from a MySQL database but can I rewrite the php.ini
>> file on the fly or am I stuck.  Any help is greatly appreciated.
>
> Why not just put it in the extra headers?
>
> $headers .= "From: $email_address_from_your_database\r\n";
>
> Or you could possibly use ini_set() to change the php.ini setting.
>
> ---John Holmes...



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: regex help?

2003-07-21 Thread sven
hi john,
try a regex like this:
'/]*>(.*)/i'
ciao SVEN

John Herren wrote:
> Can't seem to get this to work...
>
> trying to yank stuff xxx from
> xxx
>
> and stuff yyy from
>
>  yyy
>
> preg_match("| (.*)$|i", $l, $regs);
>
> works for the second example, even though it isn't the correct way,
> but nothing works for for me for the first example.
>
> Any help is appreciated!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Newbie lost in array

2003-07-22 Thread sven
hi tony,
how is your table structured? is is a csv-file, a database, a html-table,
...?
ciao SVEN


Tony Crockford wrote:
> I've got brain fade today and am in need of a clue, please accept
> apologies if this is obvious.
>
> I have a data table:
>
>  P_ref P_code P_Value
>
> I want to read the data out where P_ref='somevalue' and create
> variables for the content of P_Code with a value of P_Value
>
> what should I be looking for in the manual?
>
> TIA
>
> Tony



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Newbie lost in array

2003-07-22 Thread sven
then try:

$query = 'select * from `yourTable` where `P_ref`="somevalue"';
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
$rows[] = $row;
}

var_export($rows);

hth SVEN

Tony Crockford wrote:
>> hi tony,
>> how is your table structured? is is a csv-file, a database, a
>> html-table,
>> ...?
>> ciao SVEN
>
> Ooops!
>
> MySQL sorry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re:

2003-07-23 Thread sven
sorry, i didn't understand your problem.

can you give an example what you can get from your database (your keys,
years, months, ...) and how it should be transformed?

ciao SVEN

Etienne Mathot wrote:
> I am quite new to web programming and PHP/mySQL, I try to find my way
> between all these tools.
>
> Currently, I have a problem with a page where activities happen in 3
> steps.
>
> Encoding Key Fields is the first step, than reading the customer...etc
>
> Key Fields is composed by Year, month and auto-increment field.
>
> Up to this step, everything is Ok.
>
>
>
> But the form recalls themselves for going on.
>
> I use  for the year and the month.
>
> If anybody knows a way to redisplay the correct values of these
> fields and not "Pick Up yours"?
>
>
>
> Thanks four your help.
>
>
>
> Etienne Mathot
>
> Email: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Mail functions in php

2003-07-23 Thread sven
hi,

1. for mime-types try rfc2046. there are two top-level media types for you:
'audio' and 'video'. the subtypes depend on your media files.

2. to send files simply as attachment you can use
'application/octet-stream'. or use a readymade php-mime-mail-class.

ciao SVEN

Uma Shankari T. wrote:
> Hello,
>
> I need to send audio/video files through PHP mail() function.
> What is the MIME type i need to use?
> or else
> Is there any other way to send attachment as a mail?
>
> Please help me.
>
> Thanx in advance,
> Uma



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: homemade authentication function

2003-07-23 Thread sven
i think the problem isn't only your 'return false' but also your 'return
true' in your first loop through your foreach will definetly a 'return' be
passed. and return means return a value AND stop the function. not?

try it this way:

foreach ($groups as $value)
{
if(!isset($this->user['groups'][$value]) ||
!$this->user['groups'][$value])
{
return false;
}
}
return true;

ciao SVEN

SævË Ölêöyp wrote:
> I'm making an authentication script with groups and roles. This
> function checks if the groups the user belongs to specified groups
> and compares them to the groups required. However, since this is a
> loop, the function doesn't return true or false as expected. If I
> call the function and require 3 groups, and the user belongs to only
> one of them, he is still accepted. Is this method right thinking?
> Should I make the function stop somehow when it returns false for the
> first time? All suggestions and comments are appreciated. Thanks.
>
> This is the function:
>
> function require_groups() {
> if (!isset($this->user['groups'])) {
> $this->user['groups'] =
> $this->get_user_groups($this->id);
> }
> $groups = func_get_args();
> foreach ($groups as $value) {
> if
> (!isset($this->user['groups'][$value]) ||
> !$this->user['groups'][$value]) {
> return false;
> }
> else{
> return true;
> }
> }
> }
>
> And I call it like this: require_groups("admins",
> "moderators","members");
> This returns true.
>
> Kveðja,
> Sævar Öfjörð
> [EMAIL PROTECTED]
> þetta reddast - hönnunarlausnir
>
>  oft\Signatures\www.reddast.is> www.reddast.is



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: people who has done a POS system before

2003-07-24 Thread sven
hi,
for mobiles: there is a wap-browser for windows-plattform:
http://www.winwap.org
ciao SVEN

Tan Ai Leen wrote:
> Hi,
> I was just wondering there is a emulator for us developers to develop
> programs for palm and handphone, etc. Is there a program that
> emulates the output from various printers on screen?
>
> Regards,
> Tan Ai Leen



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Please help!!! thx a lot~~~

2003-07-24 Thread sven
hi joe,
you want a server-script, that lists a dir on a client?
i think that's impossible. think of if you visit a website written in php
and in background your hdd is scanned? that's simply a security reason.
ciao SVEN

Joe wrote:
> any alternative method is also welcome
>
> "Joe" <[EMAIL PROTECTED]> ¼¶¼g©ó¶l¥ó·s»D
>> [EMAIL PROTECTED]
>> I have written a php to show file in directories.
>> The problem is due to is_dir() can't opearate on remote files. What
>> should I do in order to fix it.
>> thx a lot~~~



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] removing parts of a string...

2003-07-24 Thread sven
hi,

Juan Nin wrote:
> From: <[EMAIL PROTECTED]>
>
>
>> I wanna be able to take a URL
>> http://www.mysite.com/downloads/file_1_a.pdf
>>
>> and then remove:
>> http;//www.mysite.com/
> [...]
>
> look at preg_match()

... or preg_replace();

>
> regards,

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: sorting multi-array

2003-07-24 Thread sven
hi,
try usort();
ciao SVEN

JiøîÆèî eË wrote:
> hello,
>
> i have got a problem, tehere is an array:
>
> $x = array(
>array(15,55,array(1,2,3),3,5,array(1,2,5)),
>array(25,55,array(1,2,3),3,5,array(1,2,5)),
>array(5,55,array(1,2,3),3,5,array(1,2,5))
>);
>
> and I need to sort this arraybz first item of sub-arrays (x[0][0],
> $x[1][0], $x[2][0]). this is the correct result:
>
> $x = array(
>array(5,55,array(1,2,3),3,5,array(1,2,5)),
>array(15,55,array(1,2,3),3,5,array(1,2,5)),
>array(25,55,array(1,2,3),3,5,array(1,2,5))
>);
>
> some idea how sort this multidimensional array? thank you for your
> reply.
>
> jiøí nìmec, ICQ: 114651500
> www.menea.cz - www stránky a aplikace



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Include Problems

2003-07-25 Thread sven
hi eric,

as far as i can see, there is no definition for your '$subnav' in your
'incHeader.php'.

if you call your main script like this:
'http://example.com/index.php?subnav="home";', this should work with your
inclusion.

ciao SVEN

Eric Fleming wrote:
> Here is a snippet from the header file.  You can see that I am just
> trying to determine what the value of the subnav variable is set to
> in order to determine which navigational link is bold.  There are
> other places the variable is used, but you can get an idea based on
> what is below.  Thanks for any help.
>
> <-incHeader.php-->
>
> 
> 
> [Site Name]
> 
> 
> 
> 
> 
>  href="index.php">home
> 
> 
> 
>
> <-incHeader.php-->
>
>
> "Jennifer Goodie" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Without seeing what you have in your includes, it will be hard to
>> determine where your scope is messed up.
>>
>>> >>  $subnav = "home";
>>>  include("incHeader.php");
>>>>
>>>
>>> 
>>>
>>> The content would go here.
>>>
>>> 
>>>
>>> 
>>>
>>> Now, when I try to reference the subnav variable in the
>>> inHeader.php or incFooter.php files, it comes up blank.  I am
>>> basically trying to adjust the
>>> navigation on each page depending on the page I am on.  I am just
>>> learning PHP, have programmed in ColdFusion for years and in
>>> ColdFusion
>>> this was not
>>> a problem.  Any ideas?



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] ereg problem?

2003-07-25 Thread sven
by the way, it's to complicated. the brackets [ and ] are used for
cha-groups. you can leave them for only one char. so this would be the same:
"\\n" (you have to escape the backslash with a backslash)

Curt Zirzow wrote:
> * Thus wrote John W. Holmes ([EMAIL PROTECTED]):
>> [EMAIL PROTECTED] wrote:
>>
>>> who can tell me what's the pattern string mean.
>>> if(ereg("[\\][n]",$username))
>>> {
>>>   /*Do err*/
>>> }
>>
>> It's looking for a \ character or a \ character followed by the
>> letter n anywhere within the string $username.
>>
>
> I hope that isn't looking for a Carriage Return, cause it never
> will...
>
> Just in case it is strstr($username, "\n");
>
> Curt



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Classes

2003-07-25 Thread sven
do you get an error-message? which?
maybe you use
var $id = array();
instead of
var $id[];

ciao SVEN

Patrik Fomin wrote:
> I need to create a class that looks like this:
>
> class Artikel {
>  var $id[];
>  var $rubrik[];
>  var $ingress[];
>  var $kategori[];
>  var $frontbildtyp[];
>  var $frontbild[];
>  var $kategoribild[];
>  var $aktuell;
>
>  function SetId($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetRubrik($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetIngress($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetKategori($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetKategoriBild($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetFrontbildtyp($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetFrontbild($id) {
>   $this->id[$this->aktuell] = $id;
>  }
>
>  function SetNextPost() {
>   $this->aktuell++;
>  }
>
>  function SetStartPost() {
>   $this->aktuell = 0;
>  }
>
> }
>
>
> the problem is that php wont let me :/, any ideas?
>
> regards
> patrick



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: File upload

2003-07-25 Thread sven
Peda wrote:
> I want to upload some file to my web site.
>
> The upload_single.php script is just this:>  $ime = $_FILES["thefile"]["name"];
>  print ($ime);
>
> I just want for begining to print the name of file.
> But It doesn't work.

did you look what comes from your form? try:
var_export($_FILES);



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Get the current file name

2003-07-25 Thread sven
how about this:
$_SERVER["PHP_SELF"];
ciao SVEN

Shaun wrote:
> thanks for your reply,
>
> but that doesn't seem to work either, how about removing everything
> after and including the ?, how would i do that?
>
>
> "Manoj Nahar" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> u can try
>> $filename=$_SERVER[SCRIPT_NAME];
>>
>> Manoj
>>
>>
>> Shaun wrote:
>>
>>> Hi,
>>>
>>> due to a current PHP upgrade i am unable to use the following code
>>> to get the filename of the page:
>>>
>>> $s = getenv('SCRIPT_NAME');
>>>
>>> I need to get the filename without any avariables attached. For
>>> example if the URL is
>>>
>>> www.mydomain.com/test.php?test=yes
>>>
>>> using $s = getenv('PHP_SELF');
>>>
>>> returns test.php?test=yes
>>>
>>> how can I return just test.php i.e. the filename on its own
>>>
>>> Thanks for your help



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] function: global, static and...?

2003-07-25 Thread sven
Curt Zirzow wrote:
> * Thus wrote Michael Müller ([EMAIL PROTECTED]):
>> Hi,
>> I was just thinking about functions, and I believe there were more
>> than two keywords like "global" and "static", which could be used in
>> functions... does anybody know them and their functions?
>
> hm. I dont even know where global and static are defined in the
> manual.

hi,
look here: http://www.php.net/manual/en/language.variables.scope.php
ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Dynamically generate a drop down list

2003-07-28 Thread sven
... or even shorter (since php 4.1.0):

function init_auth_list()
{
print " select the name of the
author";
$query="select name from author order by name";
$result=pg_exec($GLOBALS["db"],$query);
while ($row = pg_fetch_row($result))
{
print "$row[0]";
}
print "";
 }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Displaying MySQL data inside of a table

2003-07-28 Thread sven
[EMAIL PROTECTED] wrote:
> $mysql_link = mysql_connect("localhost", USER, PASS);
>
>   mysql_select_db(DB, $mysql_link);
>
>$SQL = "SELECT * FROM tbl";
>
>$result = mysql_query($SQL, $mysql_link) or die (mysql_error());
>
>echo "";
>
>while($resultat = @mysql_fetch_array($result)) {
>
>echo "
>
>   $resultat[ip]
>
> ";

here is '' missing:
";


> echo "}

the echo ''; should come after the closed while:
}
echo '';

>$mysql_link=mysql_close($mysql_link);
>
> Un saludo, Danny

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: xls2pdf

2003-07-29 Thread sven
Jan wrote:
> Hi!
>
> what's the best to convert xls to pdf (using PHP) ?
>
> maybe there is util (binary executable) xls2pdf i dont know about
> which would help me as well 

hi jan,

i don't know, whether there is such a tool.

but for your convertion it depends on what tool you got. as .xls is a
microsoft excel file you either need to parse this file manually to get your
cells and then put them to a pdf-file via a php-class or a php-extension.

but i think its much easier to work with a com-extension and force microsoft
excel to print your sheet to a vitual pdf-printer (i.e. acrobat)

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: wheres the problem?

2003-07-29 Thread sven
Ryan A wrote:
> Hi everyone,
> Am confused about what the @#%# is happening to my scripts because
> this was working yesterday, now i restarted my localhost machine and
> its not working now moreand its real simple stuff as you see.
>
> if(isset($id))
>  {
>  $result = count ($id);
> echo $result;
> echo $id[0]." ".$id[1]." ".$id[2]." ".$id[3]." ".$id[4];
>  exit;
>  }
>
> then i am passing 2 id[]'s like so:
>
http://localhost/BWH/Project/compareTesting.php?PHPSESSID=431984b7b39946fd74
> bf0b45b9771b54&id%5B2efwaf2%5D=20&id%5B2efwaf3%5D=21&type=1
>
> /* ***
> html code something like this:
> 
> 
> * */

hi ryan,

from your html-form you get:
$id = array(
'sh1' => '3',
'sh2' => '4',
);
(or something similar.)

so there is no $id[0] and so on, but $id['sh1'].

my suggestion:
if(isset($id))
{
$result = count($id);
echo $result;
echo implode(' ', $id);
exit;
}

hth SVEN




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: How to you compare dates in a query in Mysql

2003-07-31 Thread sven
take a look into mysql-manual > 6.3.1.2 Comparison Operators
ciao SVEN

Bogdan Stancescu wrote:
> Depends on what exactly you're after, but for strict comparison
> arithmetic operators work as expected (<, >, =).
>
> Bogdan
>
> Safal Solutions wrote:
>
>> Dear friends,
>>
>> Plesae help in finding the correct syntax for comparing two dates in
>> a query in MySql database
>>
>> Thank you
>> Subodh Gupta



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: xml and php

2003-07-31 Thread sven
on a windows box you don't need to compile your php (--with-domxml). i think
you installed the precompiled binaries from php.net. so if you want to
enable this extension, look into your php.ini and uncomment the following
line:

extension=php_domxml.dll

hth SVEN

Steff wrote:
> Hello
>
> I'm a beginner in php.
>
> Sorry to disturb you but I have two problems and I hope you can
> help me.
>
> I use php 4.3.2(InetPub\Php is my php directory) under windows
> 2000 server with IIS 5.0.
>
>I want to manipulate xml file with Php (add some element, modify
> some element, delete some element and consult some element) but when
> I try  domxml_open_file I obtain system error : Call to undefined
> function: domxml_open_file()
>
>I heard about use --with-dom but I don't see how and about
> php/win32 directory which I don't see.
>
>  Can you help me ?
>  Thanks
>  Cordially
>  Vauclaire Stéphane
>  http://www.c-comnet.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Mysql query and PHP loops

2003-07-31 Thread sven
did you also play with group by?
what does this return?

select * from `yourTable` group by `val1`

ciao SVEN

Petre Agenbag wrote:
> Hi List
>
> I've been trying to do something with one MySQL query, but I don't
> think it is possible, so, I would need to probably do multiple
> queries, and possibly have queries inside loops, but I am rather
> weary of that so, I'd like your views/possible solutions to doing the
> following:
>
>
> Consider this:
>
> id val1 val2 val3
> 1 a 1 1
> 2 b 2 3
> 3 a 1 2
> 4 b 2 1
> 5 c 3 3
> 6 c 2 1
>
> I need to query this table to return this:
>
> id val1 val2 val3
> 3 a 1 2
> 4 b 2 1
> 6 c 2 1
>
> Thus, I need to firstly only return ONE row for each val1, and that
> row MUST be that last row (ie, the row with the highest id, OR,
> should val3 for instance be a date, then with the highest date).
>
>
> if I do a
>
> select distinct val1, MAX(id) from table order by val1, then it
> returns
>
> id val1
> 3 a
> 4 b
> 6 c
>
> which is correct, BUT
> select distinct val1, MAX(id), val2 from table order by val1
>
> it returns
>
> id val1 val2
> 3 a 1
> 4 b 2
> 6 c 3 <--- incorrect
>
> it then returns the FIRST "hit" for val2 in the db, and NOT the one in
> the row with the max id...
>
> Can I do this with one query? ( PS, I cannot use MAX on val2 or val3,
> they are text)
>
>
> Thanks



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: HTML form handling

2003-08-25 Thread sven
Chris Baxter wrote:
> Hi,
>
> I am trying to send the results of a form to my email account and am
> having difficulty carrying the form variable through if I use an html
> mime type.
>
> Basically, if I send the form using a plain text format, the form
> results are sucessfully copied to the email, however, if I change to
> mime type to HTML (becuase I want to include a company logo and make
> the form a little easier to read by using tabulation and bold text),
> I only seem to get the HTML, not the php variables that carry the
> from info.
>
> Below is an example of the script for the body of the email, which I
> am then sending using the mail() function:
>
> $body =  
> 
> 
>
>   Applicant 1 Forename:
>
> 
> 
>   Applicant 1 Surname:
>
> 
> 
>   Applicant 2 Forename:
>
> 
> 
>   Applicant 2 Surname: 
>
> 
> 
> 
> ;

hi chris,

okay, you try to put your html-code into a string '$body', which will be
used by mail().
but, did you look at $body before sending? i'm afraid your vars are already
missing here?
maybe you have to change your code to this:





Applicant 1 Forename:
' . $App_1_Forename . ' ...';
?>

or this:





Applicant 1 Forename:
$App_1_Forename ...";
?>

look at the quotes. which style you want to use depends on you (i prefer the
1st)

ciao SVEN

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Compare dates

2003-06-05 Thread sven
you can work with a timestamp.
mktime() changes your date into a number you can sort, compare, ...
ciao SVEN

"Shaun" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I have two dates retrieved from a database stored as variables: $mindate
and
> $maxdate, how can i compare the two with PHP so i can loop and increment
> i.e.
>
> while($mindate < $maxdate){
>   //do some stuff
>   $mindate++;
> }
>
> Thanks for your help
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: SQL Select on a DATE field

2003-06-05 Thread sven
just some thoughts to your script:

i don't know (yet) the pear db functions and the database you use. so i
assume you already got some logic to transform your dates into valid
sql-dates (eg. mysql: mmdd or -mm-dd). that is important for valid
results from your sql-statements as the dates must be compared somehow. (in
other words your DD/MM/YY as an example 04/05/03 can be interpreted in many
ways.)

i assume, that in your order_date-field should only stand one statement, so
i suggest using preg_match.

so for your code i would start this way:

if (preg_match($yourBetweenDatesPattern, $order_date, $matches))
{
// between two dates
// define your filter here, maybe with your qouted_date-function from
pear
}
elseif (preg_match($YourAfterDatePattern, $order_date, $matches))
{
// after a date filter
}
elseif (preg_match($YourExactDatePattern, $order_date, $matches))
{
// exact date filter
}
else
{
echo "no valid date given.";
}

For your Patterns:

If you use something like this
preg_match ("/between ($YourDatePattern) and ($YourDatePattern)/", $subject,
matches);
you can easily catch your date1 and date2 using:
$matches[1] and $matches[2]

hope this helps.

ciao SVEN


"Lorenzo Ciani" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi all!
>
> I would like to ask your advice on a script that I wrote. As you can
surely
> see from my script below, I really need help as I am totally new to PHP.
> Regular expressions are my worst nightmare because I don't have a
> background in software programming: I'm just kidding around here! Please
> post your suggestions. Thanks.
>
> Problem
> ---
> HTML form to filter records from an SQL database on a DATE field.
> Search expressions are of the form:
>DATE (should be transformed into = DATE)
>>= DATE (or other operator)
>BETWEEN DATE_1 AND DATE_2
>
> The variable named $order_date contains the search expression submitted by
> the HTML form.
>
> Here's my script
> 
> // Regex pattern for date, e.g. DD/MM/YY or MM-DD-
> $date_pat = '[0-9]+(\/|-)[0-9]+(\/|-)[0-9]+';
> // Regex pattern for SQL operators
> $op_pat = '<>|<=|>=|!=|<|>|=';
>
> // First, see if there is at least one date in $_POST['order_date']
> $count = preg_match_all('/'.$date_pat.'/', $order_date, $matches);
> if ($count) {
>for ($i = 0; $i <= $count - 1; $i++) {
>   // Quote dates using PEAR::DB
>   $quoted_date[$i] = $db->quote($matches[0][$i]);
>}
> }
> // Then see if search string is of type BETWEEN DATE_1 AND DATE_2
> $count = preg_match_all('/between\s'.$date_pat.'\sand\s'.$date_pat.'/i',
> $order_date, $matches);
> if ($count) {
>// Yes it's a BETWEEN...AND. We assume that we have two valid dates
>$date_filter = ' BETWEEN '.$quoted_date[0].' AND '.$quoted_date[1];
> } else {
>// No. Then check if we have a search string like '>= DATE'
>$count = preg_match_all('/'.$op_pat.'/', $order_date, $matches);
>if ($count) {
>   // Yes, then use operator and quoted date
>   $date_filter = ' '.$matches[0][0].' '.$quoted_date[0];
>} else {
>   // No, then we just use something like ' = DATE'
>   $date_filter = ' = '.$quoted_date[0];
>}
>  }



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] flawless script

2003-05-28 Thread sven
you can use the default: statement as last case in switch, too.

"Jason K Larson" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Greetings-
>
> I prefer to check the $_SERVER['REQUEST_METHOD'] before I do anything in a
script that
> operates for both GET and POST methods.  Also, especially for a switch
statement, I'd
> check for the existance of the variable first, you know some sort of
isset() or !is_null()
> test.
>
> Hope that helps.
>
> --
> Jason k Larson
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: POST Values

2003-06-02 Thread sven
take a look at the $_POST array (or $_REQUEST). they contain all submitted
values.

if there are still empty fields, try foreach() and !empty().

"Shaun" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I have a page with 78 textfields on, is there a way of picking out the
field
> names and values that the user has filled in as they are very unlikey to
be
> filling in all of them?
>
> Thanks for your help
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: $_POST array

2003-06-02 Thread sven
this works too:

$message =
 $_POST['first_name']." ".$_POST['last_name']."\n".
 $_POST['address']."\n".
 $_POST['city']." ".$_POST['state']." "$_POST['zip']."\n".
 $_POST['country']."\n".
 $_POST['email']."\n".
 $_POST['design']."\n".
 $_POST['comments'];

"Zbranigan" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> > "Steven" == Steven Farrier <[EMAIL PROTECTED]> writes:
>
> Steven> I have tried using $_POST array variables in the following
> Steven> ways $message = "($_POST['first_name'])
> Steven> ($_POST['last_name'])\n($_POST['address'])\n($_POST['city'])
> Steven> ($_POST['state'])
> Steven>
($_POST['zip'])\n($_POST['country'])\n($_POST['email'])\n($_POST['design'])\
> Steven> n($_POST['comments'])";
>
> Steven> $message = "$_POST['first_name']
> Steven> $_POST['last_name']\n$_POST['address']\n$_POST['city']
> Steven> $_POST['state']
> Steven>
$_POST['zip']\n$_POST['country']\n$_POST['email']\n$_POST['design']\n$_POST[
> Steven> 'comments']";
>
> Steven> Neither of these have worked what am I doing wrong?
>
> Steven> Steve
>
>
> try it like this:
> $message = "({$_POST['first_name']})
> ({$_POST['last_name']})\n({$_POST['address']})\n({$_POST['city']})
> ({$_POST['state']})
>
({$_POST['zip']})\n({$_POST['country']})\n({$_POST['email']})\n({$_POST['des
ign']})\
> n({$_POST['comments']})";
>
>  $message = "{$_POST['first_name']}
> {$_POST['last_name']}\n{$_POST['address']}\n{$_POST['city']}
{$_POST['state']}
>
{$_POST['zip']}\n{$_POST['country']}\n{$_POST['email']}\n{$_POST['design']}\
n{$_POST[
> 'comments']}";
>
> --
> no toll on the internet; there are paths of many kinds;
> whoever passes this portal will travel freely in the world



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: problem with apache 2.0

2003-06-03 Thread sven
php.ini: register_globals = off?
look at $_POST['id'].
ciao

"Franck Collineau" <[EMAIL PROTECTED]> schrieb im
Newsbeitrag
news:[EMAIL PROTECTED]
> Greeting,
>
> I have just change my server to apache 2.0.44 and php 4.3.1 (from mandrake
> 9.1) and i have a problem now
>
>
> When i pass a numeric parameter to a  php script from a form, the
parameter is
> equal zero !
>
> Here is my form:
>  Modification d'un matériel: 
>
> 
> 
> Numéro: 
> 
> 
> 
> 
> 
> 
>
>
> here is my script php:
>
> $taille=strlen($id);
> print("ident: $id ");
> $id=(int) $id;
> ?>
>
>
> where does the problem come from ?
>
>
> Thanks
> Franck



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: LoadModule Help

2003-06-03 Thread sven
do you have an exact error message?

so far i can only point you to some often made mistakes:

- did you copy php4ts.dll to c:\winnt\system32
- did you copy php.ini.dist to c:\winnt, renamed it to php.ini and modified
it?

 - in httpd.conf added these two lines?
LoadModule php4_module PHP_DIR/sapi/php4apache2.dll
AddType application/x-httpd-php .php
(note the apache2 module)

ciao SVEN


"Tmcclelland" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi all,
>
> As you will guess from this question I'm new to all this. Firstly I hope
> this is the right list.
>  I have installed the latest version of Apache, and the latest version of
> PHP, on Windows 2000. I can start the server fine but as soon as I change
> the httpd.conf file and add the LoadModule section the server refuses to
> start.
>
> I wonder if anyone can shed any light on this. I can run PHP under IIS 5.0
> which I have installed and tried, but would prefer to use Apache. IIS has
> been fully removed from the machine before the installation of Apache.
>
> Hope someone can help.
>
> King Regards
>
> Tim
>
>
>
> **
> This email message and any files transmitted with it are confidential
> and intended solely for the use of addressed recipient(s). If you have
> received this email in error please notify the Spotless IS Support Centre
(61 3 9269 7241) immediately who will advise further action.
>
> This footnote also confirms that this email message has been scanned
> for the presence of computer viruses.
> **
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Problem on Date Function

2003-06-03 Thread sven
have a look at date() and mktime():

from the manual:
$tomorrow = mktime(0, 0, 0, date("m"), date ("d")+1, date("Y"));

ciao SVEN

"Jack" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Dear all
> Here is the situation :
>
> Our automation system will generate a large number of pdf file to a
specific
> folder every day. The name format for all these pdf file is
> ".20030602.pdf".
>  is the name of the file,
> 20030602 is last working date.
>
>
> what i want to do is:
> 1. create a sub-folder inside this specific folder, and name it to current
> month(Jun-2003)
> 2. move the pdf which is not containning last working's file name to this
> new create sub-folder.
> 3. the files with last working date's name will stay on the specific
folder.
>
> question :
>
> 1. I had used a date function with "w" parameter to check if current date
i
> execute the script is monday (1), if so , i tell the script to take the
> current date minus 3, so the date will become last friday (as our last
> working day), then i can base on this date to tell the script which files
> should not be move to sub-folder!
>
> q: how i can do a date subtraction in php? (eg. "2003-06-02" - 3 =
> "2003-05-30")
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Link to a Site

2003-06-04 Thread sven
don't echo anything before the header. else there is automatically a header
generated by your server.


"Mishari" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
> I used it before, but I had a problem
>
> my code look like,
> if (--) {
> echo "---";
> header(--);
> }
>
> I don't know what is it?
>
>
>
> --- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> > Discused few threads ago:
> > header('Refresh: 15; url=newurl.php' );
> >
> > 15 is in seconds.
> >
> > Mishari wrote:
> > > Hi all,
> > >
> > > I need help,
> > > actually I'm building a PHP site where my users
> > will
> > > wait for a few seconds reading a text then it will
> > > automatically  link them to another site.
> > >
> > > I'm looking for the command which auto. link to
> > other
> > > sites.
> > >
> > >
> > > Kind Regards,
> > > esheager
> > >
> > > __
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> __
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: unix time stamp to readable date

2003-06-05 Thread sven
use date().
first argument is the structure of your readable date,
second ist the unix timestamp.
ciao SVEN

"Diana Castillo" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> I know this is a stupid question but I am confused,
> how do I convert a unix timestamp to a readable date with php?
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: preg_match

2003-06-20 Thread sven
preg_matchtry without backslashes.

$pattern = "/$search/i";
if (preg_match ($pattern, $date[$i]))
{
echo "$date[$i]";
}

you don't need the .*? in your regex (either * or ? multiplier) as preg_match searches 
for any occurance (not from begin ^ or to end $).

ciao SVEN
  "Aaron Axelsen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED]
  -BEGIN PGP SIGNED MESSAGE-
  Hash: SHA1

  I am trying to code a search, and i need to get my matching
  expression to work right.  The user can enter a value swhich is
  stored in the vraible $search.

  What the below loop needs to do, is search each entry of the array
  for any occurance of the $search string.  If i hard code in the
  string it works, but not when passed as a varaible.  Is there
  something I am missing? Do i need to convert the $search variable to
  soetmhing?

  if (preg_match ("/.*?\\\$search.*?/i",$date[$i])) {
  print "$date[$i]";
  }

  - ---
  Aaron Axelsen
  AIM: AAAK2
  Email: [EMAIL PROTECTED]

  Want reliable web hosting at affordable prices?
  www.modevia.com

  Web Dev/Design Community/Zine
  www.developercube.com



  -BEGIN PGP SIGNATURE-
  Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

  iQA/AwUBPvKWA7rnDjSLw9ADEQIfGQCgwAO5ikh/RIN5OXoVkC8F4FH/YAoAoJE5
  zMxHkRssHbU2Vm4svv2hId8O
  =DJOi
  -END PGP SIGNATURE-



[PHP] Re: Problem with GET variables

2003-06-24 Thread sven
hi sid,

this is often discussed here.
if you use your local installation only for development purposes, you can
set register_globals = on  in php.ini.
but if you want a more secure plattform, leave it off and write you scripts
with $_GET[]. (some additional help:
http://de3.php.net/manual/function.extract.php). so you also don't rely on
register_globals by hosting externally.

ciao SVEN

"Sid" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hello,
>
> I just updated PHP on my local computer from PHP 4.0.2 to 4.3.2 (Yes, I
know, its a very very long time). I also downloded the latest version of
Apache and installed PHP as a module. Now PHP runs fine on the server. I
have a small problem though. Variables being sent via the GET method are not
getting parsed. I can acess these variables via the $_GET["variable"] method
but not through $variable. Any idea why. Most of my old PHP scripts accessed
the variables directly by their name and so this will be a very very big
problem for me. Any idea how I can get this old feature back.
>
> Thank you.
>
> - Sid
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: rtf files

2003-06-25 Thread sven
hi steven,

i don't know the rft-file-syntax, but i would start here. if you find out,
how the page break is defined, you could splitt the whole file by that.

but i assume, that works only on manual page-breaks. and like other
text-files (i.e. .txt or .doc) the page-break is done by the progamm that
opens the file. in that case, maybe a splitt by chapter or by a special
amount of lines would be a start?

ciao SVEN

Steven wrote:
> I need some advice on how to go about importing rtf files page by page
> seperatly into a mysql database, or some way  that can read a file and
> break each page into page sized sections, maybe an array, that i could
> then import to a database.
>
> The rtf files are mostly about '7mb' in size, and contain anything
> upto 200 pages, and need to be imported by :
>
> id, filename, page_number , page_content.
>
> I can read whole file into a data table, but that doesnt split the
> file page by page.
>
> Has anyone any suggestion to how this can be accomplished,
>
> Steven



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: remove characters, add newline & making a twodimensional array

2003-06-25 Thread sven
hi dore,

Dore Van Hoorn wrote:
> Well, i'm kind of a newby, but this is what i would like to do in php:
>
> 1.
> i'm writing all instances of a mysql table to a txt file, but when i
> add "\n" to go on on the next line, in the txt file there is a square
> printed.
> When i try to import the txt file into ms access, the square is not
> recognized
> by this program to represent a newline.. how can i add a newline to a
> txt
> file, that actually IS a newline (or better: hard return) and that
> will be
> recognized as one, when reading the file into another program?

seems like you are using a windows-machine, so try '\r\n' instead of '\n'.

>
> 2.
> a array contains a string of text, multiple words and interpunction.
> my first
> question: how can i remove the interpunction ( i know how to strip
> slashes
> and trim spaces..)? secondly, after this, i would like to count all
> double
> entries. f.e. when the word computer occurs twice in the sentence, i
> would
> like to make an array that is twodimensional: word-number of
> occurences (f.e. 'computer' '2'). How do i do that, for i don't
> really understand the phpmanual-explanation about this topic. And
> thirdly: how do i get both facts (word and number)
> out of the array? (all this has to produce a word-frequecylist, so if
> anybody
> has a clue how to do that..)

a little bit confusing with your interpunctation, maybe you can provide some
examples?

to your array: why not using a mono-dimensional array with your words as key
and the occurances as value?

$words = array(
'myWord1' => 5,
'myWord2' => 3,
...
);

or if you got your $word and $occurance in these vars:

$words[$word] = $occurance;

>
> 3.
> how can i upload an image to my server and then call the image back
> into
> a webpage, just by using php?

there are some articles about uploading files. if you got te file on your
server you can simply use the location in the next script:

$location = /path/to/my.file;

echo '';
(or: echo "";)

> +++
> NDore van Hoorn
> Ss1000454 AlfaInformatica-RuG
> E[EMAIL PROTECTED]
> Whttp://www.let.rug.nl/~s1000454
> +++

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Help please!

2003-06-25 Thread sven
hmm, well this post is here twice. so it works better than you thought? ;-)

Nadim Attari wrote:
> Hi php-general,
>
> I have subscribed to news://news.php.net/php.general. But when I post
> something (i'm using Outlook Express), it seems that the post is
> sent; but in fact it isn't and so I don't find my post(s) on the
> newsgroup.
>
> Help please!
>
> Nadim Attari



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: ereg_replace and quotation marks

2003-06-25 Thread sven
maybe stripslashes() can solve your problem?

Paul Nowosielski wrote:
> I'm trying to strip quotation marks out of user from input but it
> doesn't seem to work correctly.
>
> $string=ereg_replace("\"","",$string);
>
> I get a \ mark after I run a quote  through the form. When I want the
> quote turned to nothing.
>
> Any suggestions??
>
> Paul



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: twodimensional array / word-frequencylist

2003-06-26 Thread sven
hi dore,

Dore Van Hoorn wrote:
> # i would like a similar function that removes interpuntuation like
> "." etc. # all i want remaining in the array are the separate words,
> all in lower
> case

maybe you can replace your unwanted chars with preg_replace()
i.e.: $textStripped = preg_replace("/[.:;]/", "", $textInterPuncted);

> # i would like a function that pushes this word into a second array.
> # before pushing, it has to check whether or not the same word is
> already
> in the array.
> # if it is: do not push word into array, but add "1" to the number of
> occurrences of that word
> # if it is not: push this new word into array
> # all of this has to result into a word - frequency array (content
> analysis
> of free text)
> # question 1: how do i produce such an array?

how about this:
if(array_key_exists($wordInText, $occurences))
{
$occurences[$wordInText]++;
}
else
{
$occurences[$wordInText] = 1;
}

> # question 2: how do i get the two elements (word and number of
> occurrences)
>
> # together out of the array and print them to the screen?
> # f.e.: the word "computer" occurred two times in this text.

look at the array-stucture with print_r, var_dump, var_export, ...

or loop through the array:
echo "";
foreach($occurences as $word => $count)
{
echo "$word$count"
}
echo "";

hope this helps. (didn't test the code, just wote it from brain. but the
manual would be your friend)

ciao SVEN



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Regex Help with -> ?

2003-06-27 Thread sven
looks like id3v2 ;-)

how about this:
$string = "<[TIT2]> ABC <[TPE1]> GHI <[TALB]> XYZ";
$pattern = "/<\[TIT2\]>([^<]*)/"; // matches anything exept '<'; till '<' or
end of string
preg_match($pattern, $string, $match);
var_export($match);

hint to your regex:
either use quantifier '*' (0-n times) OR '?' (0-1 times)

ciao SVEN

"Gerard Samuel" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> I have a string something like ->
> <[TIT2]> ABC <[TPE1]> GHI <[TALB]> XYZ
> Im applying a regex as such ->
> // Title/Songname/Content
> preg_match('/<\[TIT2\]>(.*?)(<\[)?/', $foo, $match);
> $title = trim( $match[1] );
>
> The above regex doesn't work.  At the end of the pattern Im using (<\[)?
> The pattern may or may not end with <[
> For example searching for -> <[TALB]> XYZ
> The string, is *NOT* expected to hold a certain order as how it is
> retrieved.
> How does one go about to fix up this regex?
>
> Thanks
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: unexpected return from $_POST['foo']

2003-06-27 Thread sven
strange.

look into the sourcecode of your output-page, whether there is more
information (html-tags, i.e.).
and try var_export($_POST); instead of you echo to see what information come
with post.

maybe it's your server/php config. your code works for me.

ciao SVEN

"Kyle W. Cartmell" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
Given a page containing a form which posts data to another page...





Please enter a string.










And a page which accepts this data...











If I type "blueberry_muffins" into the text field and click submit, the
resulting output is as follows...

blueberry_muffinswakka=blueberry_muffins

However the output I expected was, of course...

blueberry_muffins

Have you ever seen anything like this?
Am I doing something wrong?
Do you need more information?

Thanks! :)

Kyle W. Cartmell
- a mildly confused PHP newb



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] New line problem - but for Excel

2003-12-04 Thread Sven
David T-G schrieb:
Manisha --

...and then Manisha Sathe said...
% 
% Actually I do not have phpscript for this. I am using readymade function
% from PHPMyAdmin 2.1.0. They are having option to export to csv file with
% delimeter ';' (It comes on screen first and then i copy to file manually.)

Ah.

% 
% So my csv fil looks like
% 
% 22;33;address line1
% address line2
hi newsgroup,

maybe a quotation helps? i remember, the php-csv-export-functions have a 
param for that. so if the results look like this:

22;33;"address line1
address line2"
the line-break isn't interpreted?

maybe someone can give it a try?

ciao SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP eregi filtering problem

2003-12-08 Thread Sven
Purpleonyx schrieb:
Greetings all, I ran into a problem today and was
hoping someone could provide an answer.
I am fetching a web page, and attempting to parse
certain variables from it.  I've done this plenty of
times in the past with no problem.  The only
difference this time is the file that I am parsing is
much larger.  The HTML file is about 42kb in size
(usually I only parse ~4kb worth).  In the web
browser, the script seems to just shut down, but
reports no errors, not even to the web server logs. 
Is there some specific max size that it can accept or
a setting in php.ini I need to modify?

Thanks
hi,

i don't think, that 42k is too much for the size of your file. mut maybe 
php simply times out while parsing? there is a php.ini-parameter 
max_execution_time and a runtime-function set_time_limit(). try 
set_time_limit(0) at top of your script fo debugging.

also take a look at preg_* functions instead of ereg_*. they are said to 
be much faster.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Problem With Apache / PHP Installation

2003-12-08 Thread Sven
Shaun schrieb:

"Ajai Khattri" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Sat, Dec 06, 2003 at 07:46:07PM -, Shaun wrote:


I have installed PHP and Apache but when i try to view a PHP file i.e.
http://127.0.0.1/hello.php i get a dialog box asking me if i want to
open or

save the file?

Any ideas why this is happening?
Assuming, your Apache is configured to load the php module:

Your Apache is not configured to handle .php files. You need
to add directives in httpd.conf for PHP files.
See PHP installation docs.

--
Aj.
Sys. Admin / Developer


Thanks for your reply,

I have added the following lines to the beginning of httpd.conf

LoadModule php4_module c:/php/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php
But am still unable to view php files...

Any ideas?
hi,

did you install apache 1.x or 2.x?
does http://127.0.0.1 or http://localhost show your apache-startpage?
did you stop and restart apache after changing httpd.conf?
did you copy php4ts.dll to one of the dirs as said in the manual?
just some thoughts from me.
every time i install a new envionment i make a file to '/htdocs'-dir 
called 'phpinfo.php' with the following:


i call this file for testing: 'http://localhost/phpinfo.php'. this file 
will also be vey useful when developing new scripts.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] problem with INSERT query

2003-12-09 Thread Sven
[EMAIL PROTECTED] schrieb:
Thanks alot for your help!!!
It was only a spacing mistake...
There should have no spacing in between each variables:
 VALUES ($tutor_name,$tutor_contact,$tutor_email,$tutor_profile)";
hi,

a space after a comma shouldn't be a problem. your problem were probably 
your single quotes. it's a different between

" ... VALUES ('$tutor_name', ...)";

and

" ... VALUES ($tutor_name, ...)";

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: spambothoney: script to pollute spammer's databases

2003-12-09 Thread Sven
Manuel Lemos schrieb:

Hello,

On 12/09/2003 12:26 AM, Daniel Hahler wrote:

I proudly announce the first release of my first PHP script:
spambothoney.
It provides a class to generate different types of email addresses
(random invalid, combination of users/hosts, with spambots IP/host,
"binary" output) and is meant to pollute the crawling spambots that
harvest email addresses from webpages.
It uses a MySQL database for configuration (through web-interface) and
for logging purposes.
I would be glad, if this is of some interest for you and you would
take a look: http://thequod.de/comp/mysoft/spambothoney (direct
download: http://thequod.de/action.php?download=1)


That is curious. This seems to be the second class that I see that seems 
to be for the same purpose. The other class also seems to be meant to 
generate honey pot e-mail addresses.

Class: Honey Pot
http://www.phpclasses.org/honeypot

I'm especially interested into security issues, but feedback in
general is very appreciated..


I read something about e-mail honey pots and I am afraid that may not be 
as useful as you think. When you say polluting crawling spambots you 
will probably be causing harm to innocent mail servers. Let me explain.

The latest spamming strategies consist on using valid sender addresses 
of inocent companies. Therefore, when you make up invalid addresses, all 
the bounces will go to the innocent companies mail servers. The more 
invalid addresses you make up the more harm you cause to innocent 
companies.

Anyway, you may want to contribute your class also to the PHP Classes 
site so you can get the feedback of tens of thousands of potential users 
that are notified when a new class is published. Despite your class 
seems to do the same as the other above, it will also be approved for 
publishing and let the users decide which is more useful.
hi,

not only the bounces are the problem, think of the traffic and the 
'innocent' isp's. ;-) i think that's not the best method for fighting 
against spam.

ciao SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Display Query Result As Editable Form

2003-12-10 Thread Sven
Sophie Mattoug schrieb:


[EMAIL PROTECTED] wrote:

Hi all,
I am creating a user form whereby I will do an "INSERT" , "SELECT" , 
"UPDATE" and of course "DELETE" for the form. Right now I am trying to 
create a form whereby when user choose to update their info, they wil 
be directed to a form where the fields region are EDITABLE , before 
that, the fields should contain their "old" info...so can i know how 
should i go about creating this kinda "Editable" fields using php 
scripting ???Fields should contain old info retrieved from the 
DB.Anyone have any idea??

Realli need some help here. Thanks in advance =)

Irin.
... or the long version, if you work with other namespaces or your 
webserver doesn't support these short tags:



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Constraint Violation when INSERT

2003-12-10 Thread Sven
[EMAIL PROTECTED] schrieb:


Hi all, 

I got the error " Constraint Violation " when I did an "INSERT" . 
Gone thru the code umpteen times but to no avail..Wondering 
where my error 
was??...Below is a snip of the block of code: 

 


$db = DB::connect ($dsn); 
  if (DB::isError ($db)) 
  die ($db->getMessage()); 

//create variables ready to go into DB 

$tutor_name = $db->quote($_POST["tutor_name"]); 
$tutor_contact = $db->quote($_POST["tutor_contact"]); 
$tutor_email = $db->quote($_POST["tutor_email"]); 
$tutor_profile = $db->quote($_POST["tutor_profile"]); 

$sql = "INSERT INTO tutor (tutor_name, tutor_contact, tutor_email,   
tutor_profile) 
   VALUES 
($tutor_name,$tutor_contact,$tutor_email,$tutor_profile)"; 

$result = $db->query($sql); 
if( DB::isError($result) ) { 
   die ($result->getMessage()); 
} 
?> 

-- 
- 
Everything was fine and the "INSERT" works, user input was 
insert into the 
database successful using the same block of code but the next 
thing i know I 
got this error anyone know watz the proz here??? 
Hope to get some help soon. Thanks in advance=) 

Irin. 


Don't you need to quote your strings? 

$sql = "INSERT INTO tutor (tutor_name, tutor_contact, tutor_email,   
tutor_profile) 
VALUES 
('$tutor_name','$tutor_contact','$tutor_email','$tutor_profile')"; 

Martin 

--

Yes, I actually quoted my string at the beginning but whenever i do 
an "INSERT" it actually insert a "NULL" value into the fields...why is this 
so???So I try not to quote the strings but I got a "Contraints Violation" 
errorWhat could be the problem>>??

--
Hope to get some help soon. All help are greatly appreciated.


Irin.
hi,

i don't know this db-class, but it seems that $db->quote() already 
quotes your values. so first take a look what comes from your form:


then, take a look what this quote-method does with your vals. eg:


if these vars constist of your information try to setup qour query 
according to mysql manual, depending on the values in your vars.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Fatal Error: PDFlib error ...

2003-12-15 Thread Sven
Matthias Nothhaft schrieb:

Hi,

I'm trying to get the pdflib work...

I use pdflib 4.0.3 downloaded from pdflib.de and php 4.3.4 on Debian Linux.

I wrote this test code:
hi matthias,
if you want to use this lib it's good to be familiar with classes and 
objects in php. the manual can help you at this. now to your code.


dl("libpdf_php.so");

$pdf = pdf_new();
you just created a php-object $pdf.
for your further methods you must explicit declare them to your objects:
pdf_begin_page($pdf, 421, 595);
$pdf->pdf_begin_page($pdf, 421, 595);
... and so on.
hth SVEN
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: help with install

2003-12-15 Thread Sven
Paul Vinten schrieb:

ok, Just installed PHP with Xitami, with Apache 1.3 AND 2. I've used PHP
versions 4.33 and 4.3.4. I'm running Windows XP, mucking around with some
pages that came with my Web Programming book, most of the php pages work,
but anything involving sessions, forms and cookies etc just doesn't work.
Anyone any pages that they know work that I can try, so I can figure out
what the problem is? Should they work, even though the PHP code is actually
quite old? (the version that came with the book is 4.0.3) The stuff works ok
under 4.0.3, but I need the functionality of the latest version for some
stuff on my Uni course... Anyone able to help me, or point me in the right
direction?
hi,

just some thoughts:

for sessions it's possible, that in php.ini 'session.save_path' or 
'session.cookie_path' isn't correctly defined?

another possiblility is, that your scripts depend on 'register_globals = 
On', which is (now) set to 'off' by default (location: php.ini). either 
you set it 'on' (not recommended, search the newsgroup for that and the 
security issues), or rewrite your scripts for "off-support", e.g. 
$_SESSION['sess_var'].

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] trouble parsing an XML document

2003-12-15 Thread Sven
hi,

Raditha Dissanayake schrieb:

doesn't look like a xml parser problem. I haven't tried your code but i 
think the error is $this->$k
no, why not a variable method depending on $k?

alfredo wrote:

Hello,
I'm trying to parse a XML doc, but the doc has some tags like:

so when I try to initialize variables:

class Documenti {
var $FILE; //nomefile
var $NUMERO; //numerodiserie
var ${'REG-ORIG'}; // here is the broblem
take a look at http://www.php.net/manual/language.variables.php:
"A valid variable name starts with a letter or underscore, followed by 
any number of letters, numbers, or underscores."
so, a minus isn't allowed in varnames!
hth SVEN

function Documenti($aa) {
foreach ($aa as $k=>$v)
$this->$k = $aa[$k];
}
i have an error:
Parse error: parse error, unexpected '$', expecting T_VARIABLE...
I tryed changing the $ position:
var {$'REG-ORIG'}; // here is the broblem
does not change anything:
Parse error: parse error, unexpected '{', expecting T_VARIABLE...
thanks for any suggestion,
Alfredo (Italy)


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Problem with adding quotations to a mysql insert statement

2003-12-15 Thread Sven
Richard Kurth schrieb:

I need to add extra quotation marks in to the following insert command for
mysql.
I need one that is part of the info right before the |$wrapper resend and
right after the
$outgoing,nobody
$query = "insert into majordomoaliases
(domain,listname,var,address1,address2)values
(/"$domname/",\"$listname\",\"a\",\"$listdomain-$listname:\",\" |$wrapper
resend -C $domaincf -l
$listname -h $listdomain $listdomain-$listname-$outgoing,nobody\")";
The whole line should look like this when it is printed out to the page it
will be written to from the database
"|/var/wrapper resend -C /var/domaincf -l list1 -h domain.com
domain.com-list1-outgoing,nobody"
I am totaly stuped on haw to add this extra quotation mark no mater what I
do I get mysql errors.
hi richard,

take a look at
mysql-manual
 /6 MySQL Language Reference
  /6.1 Language Structure
   /6.1.1 Literals: How to Write Strings and Numbers
/6.1.1.1 Strings
 "A `"' inside a string quoted with `"' may be written as `""'."
so for your query:
$query = "insert into majordomoaliases (domain, listname, var, address1, 
address2) values (\"$domname\", \"$listname\", \"a\", 
\"$listdomain-$listname:\", \" \"\"$wrapper resend -C $domaincf -l 
$listname -h $listdomain $listdomain-$listname-$outgoing,nobody\"\"\")";

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Q on RegExp & extended Char

2003-12-15 Thread Sven
Jswalter schrieb:
I've hit my limit on regular expressions.

I need to check a string to see if it contains legal characters...

A thru Z [a-z], SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE [\' -,\.]

OK, this is not a problem.

My problem comes in with extended characters, as these examples...
  González
  Vänligen
  före
  innehålla
I'm trying to build a RegExp that will see if the string is a proper name
format or not.
Names only have A thru Z, extended characters for other languages (than
English), SPACE, PERIOD, DASH/HYPHEN, APOSTROPHE
  Dr. Roger O'Malley
  Mrs. Sara Harris-Henderson
I have a RegExp to do English letters, but not the extended set...
  Manuel González
  Försök Bokstäver
  Contém Espaço-Válido
(Ok, these are not really names, but you get the idea)

Any ideas on this?

All I want to know is if a given string contains only these types of
characters. anything else would give me a FALSE.
Thanks
Walter
hi walter,
because most of these chars are extended ascii (decimal: 128-255), this 
regex should work: '/\x80-\xFF/' (hex-values). also take care of the 
minus in your regex if it doesn't stand on start or end of your 
char-group it means 'from-to'!
hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: var check not working...

2003-12-15 Thread Sven
Jas schrieb:

For some reason this will not work... my $_POST variables check for no 
form variables and display a form... if they choose an item from a 
select box it queries the database for a field matching the $_post var 
and builds a new form creating 8 separate $_post variables to check 
for.. so far it works except when selecting an item from the select box 
it will only display the first form when there are $_post vars present. 
 I think I am missing something, could someone look over my code?
Thanks in advance,
Jas

function vlans_dhcp() {
$lvl = base64_decode($_SESSION['lvl']);
if ($lvl != "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs");
} elseif ($lvl == "admin") {
$_SESSION['lvl'] = base64_encode($lvl);
if (($_POST == "") || (!isset($_POST['dhcp_vlans'])) || 
(!isset($_POST['sub'])) || (!isset($_POST['msk'])) || 
(!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || 
(!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) {
create 1st form with dhcp_vlans as $_post var;
} elseif (($_POST != "") || (isset($_POST['dhcp_vlans'])) || 
($_POST['dhcp_vlans'] != "--") || (!isset($_POST['sub'])) || 
(!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || 
(!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || 
(!isset($_POST['vlans']))) {
create 2nd form based on dhcp_vlans $_post var and create 8 
different $_post vars...;
} elseif (($_POST != "") || (!isset($_POST['dhcp_vlans'])) || 
(isset($_POST['id'])) || (isset($_POST['sub'])) || 
(isset($_POST['msk'])) || (isset($_POST['dns01'])) || 
(isset($_POST['dns02'])) || (isset($_POST['rtrs'])) || 
(isset($_POST['rnge'])) || (isset($_POST['vlans']))) {
now put 8 $_post vars in database...;
} else {
$_SESSION['lvl'] = base64_encode($lvl);
header("Location: help.php"); }
} else {
$_SESSION['lvl'] = base64_encode($lvl);
$_SESSION['msg'] = $dberrors[12];
call_user_func("db_logs"); }
}
hi jas,

the problem is, that your second form is only executed if your first 
condition is false (else if). but because of your or condition (||) only 
  one of them has to be true. right? right! so it doesn't matter if 
your $_POST['dhcp_vlans'] is not set, when any other isn't set. a 
solution might be:


hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Q on RegExp & extended Char

2003-12-16 Thread Sven
Jswalter schrieb:

...
 - allow apostrophes, but only if preceded *and* followed by a Alpha/Extend
 - allow hyphen/dash, but only if preceded *and* followed by a Alpha/Extend
...

hi walter,
how about something like this:


$_alpha  = 'a-zA-Z'; // standard latin letters
$_xascii = '\x80-\xFF';  // extended ascii-codes
$_achar  = $_alpha.$_xascii; // allowed characters
$regex = '/^['.$_achar.']+(\'|-)['.$_achar.']+$/';

?>

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: logic for displaying hierarchical data (ala windows explorer)

2003-12-16 Thread Sven
Chris W. Parker schrieb:

Hi everyone,

Last Friday I struggled for a long time with displaying some data that's
stored using the Modified Preorder Tree Traversal method. Without making
this email overly long and complicated (like my first draft was) I'd
like to simply ask if someone has any links or functions or instructions
they can give me on how to display my data in such a way.
I want the following:

Level 1A
|--Level 2A
|  \--Level 3A
| |--Level 4A
| |  \--Level 5A
| \--Level 3B
|--Level 2B
|  \--Level 3C
\--Level 2C
   \--Level 3D
What I always end up with is this (or some variant of it):

Level 1A
|--Level 2A
|  \--Level 3A
|  |  |--Level 4A
|  |  |  \--Level 5A
|  |  \--Level 3B
|--Level 2B
|  \--Level 3C
\--Level 2C
|  \--Level 3D
Any help is appreciated.

Chris.
hi chris,
just some thoughts:
i assume you build your tree from leaves to root via recursive 
functions? if so you need a logic like this:



function isLastChild($self, $parent) {
// check, whether $self is the last child of parent
// return true or false
}
if (!isLastChild($parent, $grandparent)) {
// draw your vertical line symbol
} else {
// draw just a spaceholder
}
// following draw the label of $self
?>

hope you understand, what i mean?

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] trouble parsing an XML document

2003-12-16 Thread Sven
Alfredo schrieb:
hi,

Sven wrote:

 > take a look at http://www.php.net/manual/language.variables.php:
 > "A valid variable name starts with a letter or underscore, followed 
by any number of letters, numbers, or underscores."
 > so, a minus isn't allowed in varnames!
 > hth SVEN

I agree with you but let me say the problem:
I'm parsing some XML documents, I'm not the writer of them and of DTD, 
who wrote them used some tags like: 
This is allowed in XML, but when I initialise varibles I need to use the 
same name of tags(also respect Case-sensitiveness).
This is a big compatibility problem, how can I do? I cannot change all 
the XML docs and the DTD.

bye
Alfredo
hi alfredo,

maybe you can workaround with arrays? for keys you can use any string. 
so $xml['REG-ORIG'] is valid in php.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Regex to grab a Windows Path from a String...

2003-12-17 Thread Sven
[EMAIL PROTECTED] schrieb:
My regex skills are serious lacking and after scouring the net for
relevant links I'm a bit stuck.  I've got a textarea field where I pull
user input from, and I'd like to search this entire field for a Windows
Directory Path (ex. C:\Documents\Blah).
Basically my users are allowed to specify HTML img tags in this textarea
and I'd like to make sure that they don't reference any images that are on
their local hard drive (which many of them are doing and then thinking
the HTML that I generate from that actually works when it doesn't).
Suggestions?

hi,

i would start like this:

1. get the entire src-param of your img tag:


this should search for everything between the two doubleqoutes and give 
it as $match[1] if working with this param in preg_match().

2. check this string for url or local path:

some possibilities are, to check for backslashes, as they are only 
allowed in win-paths, not in url. or to check whether your path starts 
with a letter, followed by a colon ('/[a-zA-Z]:/') as the local root 
(drive letter). if both is false assume that it's a relative or absolute 
url.
the other (better?) way is, to check generally, whether it's a valid url 
according to rfc1738 (a local win-path isn't). maybe there are existing 
functions?

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: sql query and some math

2003-12-17 Thread Sven
Patrik Fomin schrieb:

...
q2)
i got like 100 matches from a database into a $num variable,
then i want to devide that by 3 aslong as it can be done, eg:
while ($num != 0) {

ïf ($num / 3 = true){
some code to display some fields from a database
$num = $num - 3;
}
else {
some other code to display
$num = 0;
}
}
basicly i want the if statement to check if its more then 3 posts left to
print out, if not its gonna print out the remaining last 1 - 2 post in a
diffrent way (for the looks)
hi patrik,

for your second question maybe 'modulus' helps you.


gives you your remaining results (0, 1 or 2) depending on division by 3.

another possibility could be the use of 'limit' in your 
sql-select-statement.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Counting back 90 days...

2004-01-05 Thread Sven
Tristan Pretty schrieb:

I believe I can minus 10 days from $day by having...
$timestamp = mktime (0,0,0,$month,$day-10,$year);
hi tristan,
i believe, that this works with 90 days, too. mktime() takes care of 
invalid dates. otherwise you had a problem with your code with the first 
10 days of the month. give it a try.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Problem with using php at the command line with mysql

2004-01-05 Thread Sven
hi richard,

Richard Kurth schrieb:

i don't know what safe_query() does for you. if it's your own function 
from your .inc-file some code could be helpful. otherwise try this:

$result=mysql_query($query);

while($row = mysql_fetch_row($result)){
$dom=$row["domname"];
$total=getguota($dom);
$result = safe_query("update datasubused set quotaused ='$total' where domname = 
'$dom'");
}
?>
hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: i need help help with include

2004-01-07 Thread Sven
hi,

is this useful?



hth SVEN

Php schrieb:
Hi

I created a directory and files 3 directory's down

root/dir1/dir2/dir3/files

now i need to include my function file out of the root

root/dir/funtionfile

How do i do this?

I cannot create a htacess file on this server nor set my include path.

Can anyone help please

Thanks
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] STMP Configuration

2004-01-29 Thread Sven
John Nichel schrieb:
Kaushan wrote:

Hi friends,

When I'm trying to use the mail() function I got the following error :

Failed to connect to mailserver at "localhost" port 25, verify your 
"SMTP"
and "smtp_port" setting in php.ini or use ini_set() .

I'm currently using PHP 2.0.0b1 and "localhost" (Apache) as the web 
server.


PHP 2???

Do I have to install a seperate STMP server?


If you're trying to send mail thru localhost, localhost needs to have a 
running MTA (sendmail, qmail, etc), and that MTA needs to be configured 
to accept mail from localhost (default for all that I know), and relay 
for mail sent from localhost.

... and if you not want to send from localhost, you can change your 
smtp-params in your php.ini.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mp3 with php?

2004-02-13 Thread Sven
Chris W. Parker schrieb:
carlos castillo <mailto:[EMAIL PROTECTED]>
on Thursday, February 12, 2004 3:53 PM said:

does anyone know how to reproduce a mp3 file with php?


What do you mean reproduce? Copy? Create from scratch? Represent
visually?
In any case.. I'd say PHP cannot do anything but create a copy of a
file. It cannot read in data from a microphone or a cd player or the
like (as far as I know).
Chris.
but php can call external progs (e.g. exec(); system()).

so you can run lame or other progs and give the desired params like 
source- and target-file, sampling-rate, mode (mono, stereo), and so on.

maybe that's what you want?

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb:
...
  $regexp="/]*)>[^(<\/fieldset>)]*/i";
...
$result=extractFieldsets('testcontent of
helloblahgoodbye');
...
And it produced;
(0)=
(0)=[con]
(1)=[goo]
(1)=
(0)=[ attribute="hello"]
(1)=[ attribute="goodbye"]
hi,

as it is defined in regex-spec: a '^' inside a char-group '[...]' 
defines all chars, that aren't allowed, and not a string!

so the first 't' of 'content' and the 'd' of 'goodbye' don't match your 
regex anymore.

a start for a solution could be:

]*>(.*)<\/fieldset>/i';
?>
if you want to take care of your fieldset-attribs in your result, you 
can set your brackets again: ([^>]*)

some probs i can think of are nested fieldsets inside fieldsets (don't 
know by head, if this is allowed by w3). and another prob: is that you 
don't catch multiple fieldsets after another. i think there is a switch, 
that catches only the least result.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: regexp appears to be faulty (DONT actually think so)

2004-02-24 Thread Sven
Henry Grech-Cini schrieb:

Thanks Sven,

You are quite right with your "some probs" comment.
hi,

think i found it. try this:

(.*)<\/fieldset>/iU';
?>
the '/U' stands for 'ungreedy'. also note the change in the attribs-regex.

hth SVEN

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: regexp appears to be faulty!?

2004-02-24 Thread Sven
Henry Grech-Cini schrieb:

I came accross this link

http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html
">
http://www.alpha-geek.com/2003/12/31/do_not_do_not_parse_html_with_regexs.html 
Do we all agree or should I keep trying?

Henry
hi henry,

this could be an interesting discussion. i think there can be a solution 
for every problem. it's only a question of the logic.

the main problem in this example are white spaces in every kind (space, 
tab, newline, carriage return, ...) and there are solutions in regex. a 
little example: '/( |\t|\n|\r)*/' checks optional white spaces
you can also give '\s*' a try (any whitespace char). maybe it also works 
with '\r\n'?

just some thoughts.

hth SVEN

ps: it surely is possible to ignore everything between 
'', isn't it?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: deleting array elements

2004-03-09 Thread Sven
Benjamin Jeeves schrieb:

Hi All 

I have two array one with a list of items in it. Then a second array with a list of items in it what I want to be able to do is compare array1 to array2 and if a match is found in both arrays delete that match from array1 and then so now? Any help would be good.

so array1 = (1,2,3,4,5)
array2 = (1,3,5)
then print array1 and the output be 2,4

Thank you

hi,
try array_diff() or array_intersect() or any other corresponding function.
hth sven
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] varible in url question

2002-07-10 Thread sven vandamme

on my page (lessen.php)

i have a variable $sort

if this varible is empty if enterd the page then it will be set on 'day'

i have 3 links in the page

lessen.php?sort=day
lessen.php?sort=game
lessen.php?sort=player

so these links refure to the same page (itself)
on clicked it opens itself and should set the varible to day, game or player
but that doesn't happen.
can somebody help me please


see attachmend

greetz @cid




begin 666 lessen.php
M/#]P:' -"@T*:68H(21S;W)T*7L-"B1S;W)T(#T@(F1A>2([#0I]#0H-"F5C
M:&\H(G-O2(@=&%R9V5T/2)?65R(B!T87)G970](E]S96QF(CYP;&%Y97(\+V$^/"]T9#X-
J"CPO='(^#0H-"CPO=&%B;&4^#0H-"@T*#0H\+T)/1%D^#0H\+TA434P^
`
end


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Privilege system of Mysql...

2001-03-19 Thread Sven Huster

David,

i think, you can do
GRANT SELECT,INSERT ON  TO [EMAIL PROTECTED] identified by "password"
to allow only SELECTS/INSERTS on the table or just SELECTS with GRANT 
SELECT ON ...

or did i get you wrong?

Am 12:27 19.03.2001 schrieb David Bouw:
>*This message was transferred with a trial version of CommuniGate(tm) Pro*
>Hi Sven,
>
>Yes, I just started playing with the GRANT syntax..
>Only problem is that they first define a user with everything on 'N'
>
>And then they define a table in the DB with everything on Y...
>Problem is that you have to do this for all DB's which you want to allow.
>This means that newly created DB's should later be added..
>
>This is though very secure, but I am wondering if there is a way to: allow
>EVERYTHING but the following in stead of allow NOTHING but the following
>
>Bye Bye
>David
>
>
>
> > have you tried the GRANT syntax?
> > maybe this helps
> > take a look at the grant tables afterwards
> >
> > regards
> >
> > Am 11:48 19.03.2001 schrieben Sie:
> > >Hi there..
> > >
> > >I am not understanding something how the mysql priviege system works:
> > >
> > >I want to do the following:
> > >
> > >Give a user access to all tables in an database (also tables which will
>be
> > >added in the future) except a
> > >few private tables like the mysql table itself
> > >
> > >This is the way I thought it should be done:
> > >
> > >Add a user: '%','username','password','Y',Y','Y','Y','Y','Y','N','N'
>etc//
> > >Then add the following to table db
> > >
> > >'%',mysql','username','N',N','N','N','N','N','N','N' etc//
> > >
> > >Run the Flush privileges command and try it..
> > >
> > >This doesn't work!   Or I am missing something..
> > >When I think logically, I can maybe understand that the DB looks at the
> > >user table and sees that the uses has access to do everything and doesn't
> > >look further at de db table..
> > >
> > >Is this correct? What is then the solution to do what I described above..
> > >
> > >I looked at the manual, but I can't seem to figure out in what order the
> > >tables are checked..
> > >Does it stop looking further when he finds permission to do something or
> > >does it stop at the first 'N'...
> > >
> > >
> > >PS: I am not planning to use the above example, but it will help me
> > >understand how the privilege system works..
> >
> > Sven Huster
> > Senior Unix System Administrator
> > *BSD, Linux, Solaris
> >
> >

Sven Huster
Senior Unix System Administrator
*BSD, Linux, Solaris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HT access

2002-02-20 Thread Sven Jacobs

Yow


I've a question, :-)

I'm using ht access to protect a Directory with CGI in that I need use on my
website.
The htaccess uses the password file of my Linux to authenticate one.
Now I want to keep the ht access but when I login via another login script a
want my ht access to be filled in automatic 
so that I don't have to type my login and pwd again.
Does anybody have an Idea 

Thanks 



[PHP] Re: Apache is not rendering php pages. Config problem?

2002-05-10 Thread Sven Herrmann


> There is no phpmodule in there, so I cant activate it. I did   include
some
> lines from my old config:
>
> AddType application/x-httpd-php .php4 .php3 .php
> AddType application/x-httpd-php-source .phps
>

if you're using Apache 1.x you need to add:
LoadModule php4_modulelibexec/libphp4.so

or if you're using Apache 2.x
LoadModule php4_module    modules/libphp4.so


Sven



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Date calculations

2002-02-21 Thread Sven Jacobs

Hey 

I need to calculate the amount of days between 2 point
point 1 is now the second point is in the past 
the format I have is in 2002-02-25 10:02:23 ( that is the format i have in
my db )
now if I have today 2002-02-25 10:02:04 and the other day is 2002-02-24
09:02:04
That means that the delta in days is 1 day ( the hours do not mather )

Somebody an idea ?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] writing files with php

2002-02-25 Thread Sven Jacobs

Hey

How can I create files with php, I've tried somethings but php always tells
me that I don't have access.
But the Directory has 777 access and the owner is my webserver.
Can somebody help me :-)
I need this for to create logfiles 

Greetings
Sven



[PHP] Count

2002-02-25 Thread Sven Jacobs

hey

Again a small question forgive me but it's monday and the brain is still
working on sunday :-)


I want to make this sql query visual does anybody have any idea :-)
SELECT date_format(t_timestamp_opened,'%Y %m %d'),
count(date_format(t_timestamp_opened,'%Y %m %d'))  FROM crm.ticket group by
date_format(t_timestamp_opened,'%Y %m %d') order by t_timestamp_opened;

++--
-+
| date_format(t_timestamp_opened,'%Y %m %d') |
count(date_format(t_timestamp_opened,'%Y %m %d')) |
++--
-+
| 2002 01 15 |
1 |
| 2002 01 22 |
1 |
| 2002 01 23 |
3 |
| 2002 01 25 |
2 |
| 2002 01 29 |
2 |
| 2002 02 01 |
1 |
| 2002 02 06 |
2 |
| 2002 02 11 |
1 |
| 2002 02 12 |
1 |
| 2002 02 15 |
1 |
| 2002 02 22 |
2 |
++--
-+



[PHP] CGI

2002-02-26 Thread Sven Jacobs

Hey

I have some cgi files who are in the /usr/lib/xxx/cgi-bin/ directory
How can i make them a part of my php meaning that in the current situation
the url is something like this
http://x.x.xxx/cgi-bin/cgiscripts/.cgi
and i want it to be something like this
http://../index.php?action=cgi&scripts=xxx.cgi

Maybe a stupid question but 


Kind regards
Sven



[PHP] Mailing Files

2002-02-26 Thread Sven Jacobs

Is it possible to mail files with the mail() commando?
Or can it be done on a other way?

Kind regards
Sven



RE: [PHP] Crontab

2002-02-26 Thread Sven Jacobs

I've use a script that I put in my cron.weekly to execute a php script and
it works fine :-)



#! /bin/sh

#Run Report Generation Script 

/usr/bin/php4 /usr/share/netsaint/genmonrep.scp.php

Kind Regards
Sven

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: mercredi 27 février 2002 8:04
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Crontab


On Wednesday 27 February 2002 13:11, Uma Shankari T. wrote:
>  Hello,
>
>
>I need to run one php script using crontab.I am having this doubt.If
> the phpscript run in the command prompt then only we can run the script
> using crontab...please tell me how do i go about with this..

You can have crontab run lynx/links to access your php page.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
It's not the fall that kills you, it's the landing.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] I can't find the problem - parsing error

2002-02-27 Thread Sven Jacobs

 

-Original Message-
From: Pax [mailto:[EMAIL PROTECTED]]
Sent: mercredi 27 février 2002 16:47
To: [EMAIL PROTECTED]
Subject: [PHP] I can't find the problem - parsing error


I have the following line of code:


$this->html=$this_>html + "

  <-- this line

...


";

I get Warning: unexpected character in input '\' (ASCII=92) state=1
And Parse Error in the same line..I am just sitting and looking at that
line and can't find the problem..can anyone see the problem?

Paul




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Javascript question...

2002-03-01 Thread Sven Jacobs

  
function openpopup(){
var popurl="url"
winpops=window.open(popurl,"Solution","width=500,height=400,")
}   
 //openpopup()
    

   

Kind Regards
Sven
-Original Message-
From: Philip Jeffs [mailto:[EMAIL PROTECTED]]
Sent: vendredi 1 mars 2002 12:41
To: PHP LIST
Subject: [PHP] Javascript question...


Hi,

I know this is a PHP list but i thought someone might be able to help me
out.

I was looking at the Levi's website the other day and i noticed a cool
script on there for opening pop-ups. They have managed to get rid of the
usual window borders altogether and it looks really good.

They have managed to do it by opening the pop-up window in full screen mode
and then making the window smaller and positioning it in a certain place on
screen.

I've figured out how to open it, shrink it and position it but for some
reason i the scroll bars are always there. The levi's site has no scroll
bars.

Does anyone know how to get rid of the scroll bars?

Thanks in advance,

Phil



[PHP] Active Directory

2002-03-01 Thread Sven Jacobs

Hey All


Does anybody have any idea how to authenticate agains a Active Directory
Server with PHP ?
And if sow :
-- How does it work 
-- What do I need to install 
-- Some sample code would be nice :-)

Kind Regards
Sven



[PHP] Of Topic but urgently needed

2002-03-04 Thread Sven Jacobs

yow all

I know this is an of topic question but with all the system admins here
.
Does anybody know a good tool where I can monitor Compaq Proline servers
with that uses some kind of text file or csv.
So I can inport that file in mysql and do some thing on it via PHP :(

Maybe some of you did something like what I want to do and can give me a
push in the direction needed :-)

Thanks anyway
Greetings
Sven



  1   2   >