Re: [PHP] How to point at a spot and get relevant information?

2003-08-14 Thread skate


>
> > Dear all,
> >
> > Anybody knows how to write a graphic plotting code such that when users
> > point
> > at that spot, they can get the information relevant to that spot? Thanks
> > in advance.
> >


that'd be pretty intense. to do this feasbly with PHP, you'd have to analyse
the picture first with the GD library. but to allow the user to interact
with this, your gonna have to store all values into JavaScript. the users
interaction can't be done with PHP, as that's all client side.

this would result in possibly huge amounts of code to download, and fairly
high processing time. i don't know if there's a javascript alternative, or
maybe some other technology someone's made. this wouldn't be so hard in
flash tho...



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



Re: [PHP] greedy preg

2003-08-14 Thread skate


> Do you need to use ".*?"? If there will be only white characters, use
> \s* instead.
>


unfortunately there's some content either side of $file before 
this content is different for each item, so i can't define it in the
pattern.



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



Re: [PHP] magical file writing truncation

2003-08-14 Thread skate


> > [snip]
> >   $newFile = "xml/".$type."/".$now.".xml";
> >   while(file_exists($newFile))
> >$newFile = "xml/".$type."/".$now++.".xml";
> >   $text = $_POST['text'];
> >   $text = urlencode(stripslashes(nl2br($text)));
> > [/snip]
> >

ack, sorry to double post...

it appears that it actually reverse truncates the $text... so it cuts off
the beginning of the text, and leaves the end bit. i can understand this
happening as an XML interpreter as the  tags get in the way, but these
are urlencoded, and writing to the file has nothing to do with the XML
functions.

i dunno if this is maybe a bug in PHP? i can't get my head round why it
looses have my string in 2 lines...

thanks again for the help...



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



Re: [PHP] magical file writing truncation

2003-08-14 Thread skate

Let's work backwards then. Instead of
$text = urlencode(stripslashes(nl2br($text)));

try
$text = urlencode(nl2br($text));
echo "$text";

Can you post the first couple of raw lines of text and then the echo'd
output?

--

okay, the first few lines of raw text are as follows... it's a chat log
btw...

Session Start (Yahoo! - fatcubanskate:the_lady_in_waiting1982): Thu Jul 10
21:23:42 2003 [21:23] the_lady_in_waiting1982: hey sexy!!! [21:24]
fatcubanskate: hey sugar [21:24] fatcubanskate: how\'s thing? [21:25]
the_lady_in_waiting1982: you know we could do a whole roll playing thing,
that would be a big as turn on [21:25] fatcubanskate: oh really? like... i
pretend to be a pirate? [21:25] fatcubanskate: raaar!!!

and then the first few lines of the echo'd output...

Session+Start+%28Yahoo%21+-+fatcubanskate%3Athe_lady_in_waiting1982%29%3A+Th
u+Jul+10+21%3A23%3A42+2003+%3Cbr+%2F%3E%0D%0A%5B21%3A23%5D+the_lady_in_waiti
ng1982%3A+hey+sexy%21%21%21+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3A
+hey+sugar+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3A+how%5C%27s+thing
%3F+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+the_lady_in_waiting1982%3A+you+know+we+c
ould+do+a+whole+roll+playing+thing%2C+that+would+be+a+big+as+turn+on+%3Cbr+%
2F%3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+oh+really%3F+like...+i+pretend+to+
be+a+pirate%3F+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+raaar%21%21%
21

seems about right?





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



Re: [PHP] find string

2003-08-14 Thread skate

>
> if ($action!='a1' || $action!='a3') //tried == also
> {
> //do stuff
> }
> else
> {
> //do other stuff
> }
>

the logic behind this particular one doesn't work... if it's either not one,
or not the other... it'll always be true... unless both are set to exactly
the same...

the logic if($action=="a1" || $action == "a3" ) should work find tho, coz
it's checking to see if either is true...

check what $action is actually set to by doing a print just before your if
statement, and then stick two print's inside the if... true and false, in
the respective place...

hope this helps...



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



Re: [PHP] send group of files at once to website administrator

2003-08-14 Thread skate

> Hi,
>
>  I have the following code which I use to make regular backups of my
> databases. Is there a way to have all backup files sent at once after they
> are created, istead of presenting the list of files available for
download?
>


send an email...

there should be plenty of mime mailers around, just download the code, and
use this as a bolt on to send your email with attachements. it's pretty easy
once you've got the mime part setup and sorted. coding this yourself can be
an arse tho... well, i think so anyway :p



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



Re: [PHP] Half solved (was foreach in search)

2003-08-14 Thread skate

> 
> $someVar=$test[0]. "&" .$test[1]. "&" .$test[2].etc
> 

$someVar = implode( "&", $test );

... should do the trick



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



[PHP] magical file writing truncation

2003-08-14 Thread skate
so i'm writing to a file, but it's truncating part of the content, but not
as i'd expect...

see the code below, it writes to the file fine, and everything should be
there, no errors. the problem occurs when it gets to writing
. for some reason, it's truncating the content. but i'm not
sure why, or how? if i change the way i treat the $text before i put it into
the file, it'll truncate more/less. no idea why, or what it depends on to
truncate this stuff. i tried playing with wordwrap also as maybe it didn't
like sticking more than xxx characters per line, but this made no
difference. i'm writing a file that is over 5000 characters long. the file
writing seems to be fine with short lengths.

like i said, the code works fine, and the print $newContents prints out
exactly what it should write. however when it gets to writing (2 lines
later) it's truncated the $text portion of the $newContents, but it
shouldn't even have any recognition of their being any difference? surely?

i'm hoping that i'm missing something simple with variables passing by
reference or what-not, but i can't find anything to suggest it in the
manual. i'm not passing by reference as far as i know, but this is the only
way i can think of what the problem can be.

FYI: i'm using urlencode as certain characters are causing problems with the
XML structure of my files, and this seems to solve it nicely.

help???

much appreciated...

-skate-


code


  $newFile = "xml/".$type."/".$now.".xml";
  while(file_exists($newFile))
   $newFile = "xml/".$type."/".$now++.".xml";
  $text = $_POST['text'];
  $text = urlencode(stripslashes(nl2br($text)));
  $newContent = "\n";
  $newContent .= "\n";
  $newContent .= "\t\n";
  $newContent .= "\t\n";
  $newContent .= "]>\n";
  $newContent .= "\n";
  $newContent .= "\t".urlencode($_POST['title'])."\n";
  $newContent .= "\t".$now."\n";
  $newContent .= "\t".$text."\n";
  $newContent .= "";
  print $newContent;
  touch($newFile);
  $fp = fopen($newFile, "wb");
  fwrite( $fp, $newContent );
  fclose( $fp );



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



Re: [PHP] magical file writing truncation

2003-08-14 Thread skate


[snip]
i really can't get my head around this one at all. could it possibly be
a
windows issue??? i know windows can be an arse in dealing with files,
but i
can't see how it could pick up on a variable inside PHP and truncate it?
[/snip]

I just have one more thought because you brought up Windows. Change the
name of the variable "$text" . text might just be one of those
reserved or key words

-

nope, same deal...

ah well, thanks again :)




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



Re: [PHP] greedy preg

2003-08-14 Thread skate


> And what about [^>]* -if there are no html tags
>

not thought about that, but XML tags, not HTML tags... does that make any
difference?



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



Re: [PHP] greedy preg

2003-08-14 Thread skate

> Not sure if I understand you correct but
> the way you wrote your replace pattern the result should be
> .
> If you want just the file to be replaced you have to use something like
> preg_replace("|.*?($file).*?|si",'\\1',$contents)
>

no, i want just the whole  replaced for that particular file.
the pattern i wrote shouldn't... doesn't touch the  section at all.

wouldn't the pattern you wrote replace the whole  with the file
tho?



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



Re: [PHP] ignore_user_abort()

2003-08-14 Thread skate
> Are there any disadvantages to turn on this feature?
>
>

what if someone submitted the wrong info? or maybe the wrong credit card
details? they genuinely might want to abort.

although to be fair, these people are the stupid ones the need to be
punished and banned from the PC.

i can't think of any other major ones, although i don't know how it effects
the actual running of PHP...





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



Re: [PHP] magical file writing truncation

2003-08-14 Thread skate

I didn't see anything right off of the bat. You may want to output the
text both ways and then compare them using
http://us3.php.net/manual/en/function.strcmp.php






apart from the fact that the slashes are there in one, and not in the other,
there is no difference...


  $fp = fopen($newFile, "wb");
  $bytes = fwrite( $fp, $text );
  print $bytes." written";
  fclose( $fp );

... tells me that 5287 bytes were written, and my file shows the full
text...


  $fp = fopen($newFile, "wb");
  $bytes = fwrite( $fp, $newContent );
  print " - ".$bytes." written";
  fclose( $fp );

... tells me that 5520 bytes were written, but opening the file shows that
half the text is missing...

the number of bytes wrtten seems to be correct. if i run a strlen() against
each string, then i get the same length as bytes, so that sounds about
right... but the files just aren't right. everything would point to the fact
that everything is happening correctly... but it just isn't...

i really can't get my head around this one at all. could it possibly be a
windows issue??? i know windows can be an arse in dealing with files, but i
can't see how it could pick up on a variable inside PHP and truncate it?



obviously there's no simple solution here... can anyone point me in the way
of an alternative way of doing this? i could try the file write in 3 stages,
first part of content, text, end of content, as they seem to write fine
seperatly.

arse...

thanks loads for your help so far tho jay...



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



Re: [PHP] greedy preg

2003-08-14 Thread skate
$contents = preg_replace( "|.*?".$file.".*?|si", "",
$contents );

okay, so i figured out that it's matching the first occurence of 
which will always be the first record and then going on to match the $file
and deleting everything between. obviously not what i want.

without giving  a unique attribute and without preg_match_all and
looping through them all, is there any other way to do this? make it find
the first occurence of  previous to $file, rather than from the start?

i hope this makes sense, and is a little clearer than i've been so far...



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



Re: [PHP] Half solved (was foreach in search)

2003-08-14 Thread skate

> implode.why the [EMAIL PROTECTED] didnt i think of that??
> Thanks dude.
> Just one last question, the last variable i am getting is page=1, how do i
> increase this?
> Basically I need to do a $page++
>

so do it then

$xxx=0;
foreach ($_GET as $a => $v) {
   print "Current value of \$a:$a and \$v $v.\n ";
   if( $a = "page" )
$v++;
   $test=$a."=".$v;
   $test1[$xxx]="".$test;
   $xxx++;
}


does that look right? i think that's what your after anyway...



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



Re: [PHP] greedy preg

2003-08-11 Thread skate
>
> You cannot store file pointers.  If you output the variable it's going to
> look something like "Resource ID #1" which is meaningless except to the
> instance of the script that created it.  Or did you mean something
different
> by "$file pointer"?


sorry, wrong words...

when i meant $file is equal to something like "xml/news/1023823.xml"




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



Re: [PHP] Correct Coding

2003-08-11 Thread skate


> That can generate an error if $Task was never assigned a value.
> 

could you not do 

if(@$Task == "Add" ){do something }

to suppress the error of the variable not being set?



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



Re: [PHP] magical file writing truncation

2003-08-10 Thread skate
[snip]
Session+Start+%28Yahoo%21+-+fatcubanskate%3Athe_lady_in_waiting1982%29%3
A+Th
u+Jul+10+21%3A23%3A42+2003+%3Cbr+%2F%3E%0D%0A%5B21%3A23%5D+the_lady_in_w
aiti
ng1982%3A+hey+sexy%21%21%21+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskat
e%3A
+hey+sugar+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3A+how%5C%27s+t
hing
%3F+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+the_lady_in_waiting1982%3A+you+know+
we+c
ould+do+a+whole+roll+playing+thing%2C+that+would+be+a+big+as+turn+on+%3C
br+%
2F%3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+oh+really%3F+like...+i+pretend
+to+
be+a+pirate%3F+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+raaar%21
%21%
21
[/snip]

OK, put stripslashes back in and show the echo'd out put again.

-

  $text = urlencode(stripslashes(nl2br($text)));
  print $text;

..

Session+Start+%28Yahoo%21+-+fatcubanskate%3Athe_lady_in_waiting1982%29%3A+Th
u+Jul+10+21%3A23%3A42+2003+%3Cbr+%2F%3E%0D%0A%5B21%3A23%5D+the_lady_in_waiti
ng1982%3A+hey+sexy%21%21%21+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3A
+hey+sugar+%3Cbr+%2F%3E%0D%0A%5B21%3A24%5D+fatcubanskate%3A+how%27s+thing%3F
+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+the_lady_in_waiting1982%3A+you+know+we+coul
d+do+a+whole+roll+playing+thing%2C+that+would+be+a+big+as+turn+on+%3Cbr+%2F%
3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+oh+really%3F+like...+i+pretend+to+be+
a+pirate%3F+%3Cbr+%2F%3E%0D%0A%5B21%3A25%5D+fatcubanskate%3A+raaar%21%21%21



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



Re: [PHP] magical file writing truncation

2003-08-09 Thread skate

>
> obviously there's no simple solution here... can anyone point me in the
way
> of an alternative way of doing this? i could try the file write in 3
stages,
> first part of content, text, end of content, as they seem to write fine
> seperatly.
>

this is magical, evening seperating the file open, and file write into 3
stages, it still looses half my $text, but again, if i write $text to it's
own file, then it's perfectly fine, and all contents go inside...

i have this...


  print "start: ".strlen($newStartContent)."";
  print "text: ".strlen($text)."";
  print "end: ".strlen($newEndContent)."";
  touch($newFile);
  $fp = fopen($newFile, "ab");
  $bytes = fwrite( $fp, $newStartContent );
  $totalBytes += $bytes;
  print " - ".$bytes." written";
  fclose( $fp );
  unset( $fp );
  $fp = fopen($newFile.".txt", "at");
  $bytes = fwrite( $fp, $text );
  $totalBytes += $bytes;
  print " - ".$bytes." written";
  fclose( $fp );
  unset( $fp );
  $fp = fopen($newFile, "ab");
  $bytes = fwrite( $fp, $newEndContent );
  $totalBytes += $bytes;
  print " - ".$bytes." written";
  fclose( $fp );
  unset( $fp );
  print "Total size written ".$totalBytes;

i figured i would totally kill $fp each time with an unset just incase. in
the above example the $text is being saved to a different file, and the
write is fine. take the ".txt" off so it saves to the same file, and it cuts
off half the $text again.

truly magical... i'm gonna have to rethink this whole thing aren't i? ah
well...

thanks again for the help...



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



Re: [PHP] magical file writing truncation

2003-08-08 Thread skate
> [snip]
>   $newFile = "xml/".$type."/".$now.".xml";
>   while(file_exists($newFile))
>$newFile = "xml/".$type."/".$now++.".xml";
>   $text = $_POST['text'];
>   $text = urlencode(stripslashes(nl2br($text)));
> [/snip]
>
> At this point (for testing putposes) I would echo "$text"; and start
> looking for clues. If I were a betting man I would have to say that
> there is some problem with quotes within the text. I hope that this
> points you in the right direction.

been doing some more testing. $text seems to stay intact throughout, it is
exactly what it should be. if i do an fwrite( $fp, $text ) then it writes
perfectly all contents of the $text as i would expect. i shouldn't get any
problems with quotes or other characters as the whole lot is urlencode()'d

> Have a pleasant and fruitful day!

wow, everyone on this list should be THAT cheery :) thanks mate, you too!



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



Re: [PHP] Flash Actionscript List or Forum

2003-08-08 Thread skate

> Hello all,
>
> I've been doing PHP for a little while now... I am starting learn Action
> Script now... and having trouble with global variables and functions...
> does anyone know where I find a good list or forum for action script?


flashkit.com is pretty good. i get a lot of resources from there. as for
lists, i actually don't know any good ones. if your on any newsgroups,
there's a couple in there, but they're not very high volume. nothing like
this for instance.

macromedia also have their forums which can be very useful at times.

if you want to email me your problems tho, i can take a look at them.
basically a variable/function will be global to a specific frame, so if you
want a global variable, i'd suggest sticking it on it's own layer, on the
_root movie. you should be able to access it from anywhere with
_root.variable.

i don't know if flash supports any truely global stuff... although i could
be wrong, coz i'm a flash 5 boy, and haven't done much mx'ing yet...

-skate-



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



Re: [PHP] Attention everyone 0-t

2003-08-08 Thread skate

>
> any ideas on what we can do about it?
>

set the server up to change the sent from email address to
[EMAIL PROTECTED]

this'll not only stop the spambots and spam blockers picking up on
individual email address', but also means that when people reply to all,
that you don't get 2 emails in response.

it does raise other problems tho... but that's my 2 cents...



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



[PHP] greedy preg

2003-08-07 Thread skate

  $contents = preg_replace( "|.*?$file.*?|si", "", $contents );

it's being run on an XML file, where each entry is .. with
a $file pointer in there.

it works okay, except for the fact that it deletes that record, and every
record before it. i can't figure out why it's being greedy? i know i gotta
be missing something real simple...



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



Re: [PHP] greedy preg

2003-08-06 Thread skate

> What are the possible values of $file? Are you looking to replace just a
> specific occurance of a $file between  tags? Maybe this will help:
>
> $contents = preg_replace("|[^<]*$file[^<]*|si","",$contents);
>
> or just use the 'U' modifier for "ungreedy"...
>

i'm looking to replace the entire  for that respective
file.

the file will have a value of whichever file that record points to, and will
be unique (xml/news/12312312.xml)

should .*? not be ungreedy tho?



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



Re: [PHP] greedy preg

2003-08-06 Thread skate

>
> Yeah, it should be. What kind on content can be around $file and also
> within the  tag?
>

here's a snip of the xml file...

it's finding the $file correctly, but deletes all records from the beginning
of the file onwards. it leaves the xml file with valid xml ...  at the
start... so for the most part the preg is working... it's just being too
greedy at the start for whatever reason...


 
  fhh
  1060205191
  hhh
  xml/news/1060205191.xml
 
 
  fgjghjh
  1060205186
  fgjh
  xml/news/1060205186.xml
 
 
  fgjhh
  1060205182
  fghh
  xml/news/1060205182.xml
 




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



[PHP] easier than switch

2003-08-04 Thread skate
okay, so i know there's an easy way to do this, and i've seen it done, sure of it. so 
please forgive the stupidity of my question, i don't even know where to begin to look 
in the archives either...

i have several forms on one page, they all submit a different variable, i then want to 
set one variable depending on that... okay, now i'm confusing myself, lets try explain 
it with some code...



obviously this doesn't work. but i wanna set $type depending on which $_POST variable 
was sent. only one of these will ever be sent. rather than doing a big ass switch 
statement, is there no way i can get this into one line?

i hope this isn't too confusing...


Re: [PHP] connecting access (*.mdb) database with PHP

2003-08-02 Thread skate


> how can I connect access database(*.mdb) with php?  what is the code?   I
> will be happy if you write php code.
>
>


damn, i'd be happy if other would write my code too...

check out the COM connections in the manual. best place for you to start,
should be able to connect to most ms applications. i'm not sure about
connecting directly to an mdb file tho...




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



Re: [PHP] Using eregi_replace()

2003-08-01 Thread skate
>
> you could also use different delimiters and write for example:
> '/.*?(hello.*going).*/' or '[.*?(hello.*going).*]' the regular
> expression itself is merely ".*?(hello.*going).*" which matches the
> whole string and replaces it by the first matching expression
> sourrounded in by ()s (thats the '$1').
>
>

just a minor correction, i don't believe you could use
'[.*?(hello.*going).*]' as the delimiters have to be the same character.

the reason you use delimiters is so that you can use PREG modifiers after
the last delimiter, but still inside the expression. read up in the manual,
as the posibilities of PREG are enourmous...

-skate-



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



Re: [PHP] Trouble getting $HTTP_RAW_POST_DATA

2003-08-01 Thread skate
> Since print_r is usually used for debugging, it would be nice that
> php does this for you.  Any comments on this before i throw the
> idea to the php-dev list?
>

if it's just used for debugging, can't you just use the  tags around
it? i mean, it's no big deal, and you don't really need it formatted to look
pretty.

that's how i use it anyway...



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



Re: [PHP] Simple Math Calculation Problem....

2003-08-01 Thread skate
> The int() function is for C/C++ programming only.  This Int() function is
> not supported in PHP.  In PHP it would be Intval().  For float,
Floatval().
> For double, DoubleVal().  Etc.   But beware of the Octual numbers.
>

sorry, confusing my flash action script again :(



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



Re: [PHP] Simple Math Calculation Problem....

2003-08-01 Thread skate

>$Days = (($clockDate - $inputDate) / (24 * 3600));

$Days = int(($clockDate - $inputDate) / (24 * 3600));

you tried that? 



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



Re: [PHP] Trouble getting $HTTP_RAW_POST_DATA

2003-08-01 Thread skate

> Also, print_r() does not include any HTML formatting, so you will need to
> look at the source for the page in the browser to make it readable.

or your could use ...



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



Re: [PHP] splitting content into pages

2003-07-31 Thread skate

>Another solution would be to abandon the idea of a fixed size
>background. Try to make it variable instead.

althought not the most cross browser effective, you could also try some css
to fix the background...

style="background-repeat=none"

should do the job.




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



Re: [PHP] Right Click Hyperlink

2003-07-31 Thread skate


> Does anyone know if there is anything in PHP or any other language that
> would
>

you can't do this in PHP, physically impossible. you also can't do it with
any other server side language. the only way to do it is with a client side
language, such as the JavaScript ways posted, or possibly there's a VBScript
way too.



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



Re: [PHP] Possible My Website was hacked... with PHP... please tell me what this is???

2003-07-31 Thread skate

> Although this is a very good idea it would only benefit people who had
> access to their own installation of PHP. Most people are only able to use
> PHP on a shared server so perhaps wouldn't have access to the php.ini
> file.
>

but then most service providers could protect themselves? i don't see why an
ISP wouldn't quite happily want to disable exectable uploads? and again, if
this is default on install, it's something they wouldn't have to worry about
configuring, and they can leave their whiley users to upload to their hearts
content.



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



Re: [PHP] Possible My Website was hacked... with PHP... please tell me what this is???

2003-07-31 Thread skate

> > Yeah, definatley reason to explore the possibilities... But this is
> > really my own stupid fault it got there in the first place... I had an
> > image upload form and I didn't tell it only to accept image/jpeg or
> > image/gif
>

i see this happen quite a lot, both in these lists, and the security focus
ones. is there not something that can be set from a default install on the
php.ini ? make it that by default php only accepts images / zip files /
documents ? it seems to give PHP a reputation for being very easy to
compromise.

sorry, this probably should be a new post, but this is kinda following on,
so please forgive me :)

-skate-



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



Re: [PHP] Re: How can I add records to database every 60 minutes???

2003-07-30 Thread skate

>i take it scripts are being called over and over right? if so then add
a
> time function to one of those scripts. when gameplay starts load the time
to
> mysql (or a file) and then everytime the script is run check the time to
see
> if the time has exceeded 60 minuets, if it has run you php script to load
> the data to mysql.


the trouble with this is what if no-one hits the page for several hours?
will it run 3-4 updates at once, or just the one?

i'm guessing what your actually after is cron. you'd be running it on a *nix
box for this, but you get cron to run the script every hour.

i'm guessing your making some kind of ticker? similar to that in
www.planetarion.com ? it's a fairly easy thing to do, and if you do a search
for planetarion clones, you'll find exactly what your looking for.

don't have a script that runs permanently tho, please. huge waste of
resources, and you've also got the problems of timeouts, and how to restart
a script if it crashes.




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



Re: [PHP] List Problems

2003-07-28 Thread skate


> Any body else getting a message back with subject like:
>  [ERR] Re: [PHP] subject of message.
> 

yeah, i'm getting that every now and then. maybe 1 or 2 a day tho...



-- 
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 skate
> Is it possible to have a function which echoes the values as they are
> read from the database?

something like

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);
 $numrows=pg_numrows($result);
 $i=0;
 while($i<$numrows)
 {
 $row=pg_fetch_row($result,$i);
 print "option name=\"".$row[0]."\">$row[0]";
 $i++;
 }
 print "";
 }

>
> I tried doing something of this sort..but didn't work..
> Any suggestions?
> Thanks in advance,
> Mukta
>

hope it works, this is just from the top of my head...

-skate-



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



Re: [PHP] Array help

2003-07-28 Thread skate
>because in reality I don't have just these 4 fields
> but 43 fields in one table that have to be taken. "Select *..." seems a
much
> easier way to get it
>

you have 43 fields in 1 table? if you are seriously considering offering
hosting packages, then i'm guessing your wanting to be half professional
about it. you should look into restructuring you table. do you really NEED
to have all 43 fields in 1 table? i've made the same mistake myself, and
believe me, it's a lot easier if you simplify your tables. you might get a
little more complicated code, but it'll help you tremendously in the future.




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



Re: [PHP] How is this possible?

2003-07-27 Thread skate


> Hi,
> Thanks for replying.

no probs...

>
> I have not worked with arrays much other than simple arrays like the $_get
> or $_post and the database ones...can you give me a another emample on how
> to do this please?
> like how to put my db into an array and then call each part
>

sorry, i'm probably not the best person to give a full working example. my
code works for me, but it's a little sloppy. check the php manual. look-up
associative arrays.

lets see if i can't give you a quick example tho...

"
for( $c=0; $c<4; $c++ )   //4 coz there's 4 key fields
{
//print the id's
print "";
print "ID";
for( $i=0; $i<$n; $i++ )
print "".$content[id][$i]."";
print "";
//print the titles
print "";
print "TITLE";
for( $i=0; $i<$n; $i++ )
print "".$content[title][$i]."";
print "";
//print the text
print "";
print "TEXT";
for( $i=0; $i<$n; $i++ )
print "".$content[text][$i]."";
print "";
//print the date
print "";
print "DATE";
for( $i=0; $i<$n; $i++ )
print "".$content[date][$i]."";
print "";
}
print "";

?>

like i said, this isn't the most glamorous way of doing it, and you really
should look this all up in the manual before trying it out. but if you run
this code (and you have a db to back it up) you should get a table with the
format i think your after...


>
> Thanks,
> -Ryan
>

no probs, hope my sloppy code helps you a little ;)

-skate-



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



Re: [PHP] How is this possible?

2003-07-27 Thread skate
> You say: Nothing special html wise.
> then can you tell me how its done?

there's some nice simple CSS behind it to give the nice border and colour
changes, but yes, nothing special HTML wise. it's a simple table

>
> The content is dynamic being pulled from the database..how do i get it in
> one table in that layout?

the best way is gonna be to put all your db content into an array and then
sort through it from there. if you use an associative array, you can put
each table row together...

display[setupfee][] = $result[0][0];
display[setupfee][] = $result[0][1];
display[monthlyfee][] = $result[1][0];
display[monthlyfee][] = $result[1][1];

... and so on.

not sure if i'm explaining this very well, or with the greatest syntax, but
hopefully you get the idea...

-skate-



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



Re: [PHP] Flash Variables

2003-07-27 Thread skate



> Hi Everone, I had a question about PHP and Flash. I have a navbar buttons
> that I made in Flash MX, but the PHP script I want it to be displayed for
is
> an auto-generated photoalbum, so the "Next" and "Previous" buttons have
need
> to change meaning at every pageload. I was wondering if there is a way to
> pass a variable on with the script to that I can program the button to
> "getURL $nextpage" or something of the sort. Thanks a bunch,
> Taylor Smith
>

when your loading your flash movie, inside the param and embed tags, after
the filename, include your variables as you would using GET...








this will pass the variables directly into _root in your flash movie where
you can utilise them from there. this should solve your problem. although
please excuse any syntax errors, this is straight from the top of my head...

-skate-


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



Re: [PHP] Your E-Book

2003-07-27 Thread skate
dammit!!!  the link doesn't work... i was REALLY excited to find out what my
boss doesn't want me to know!!!

it's also reassuring to know (reading at the bottom) that this is NOT
SPAM!!! i feel safe knowing that this isn't actually spam, and that all
members of this list actually requested this email...

- Original Message -
From: "Adrian" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 27, 2003 7:03 PM
Subject: Re: [PHP] Your E-Book


> oh fuck you, damn spammer...
> i hope someone hacks your damn spam server...
>
> 
> > The Revolutionary Book
> > Your Boss Doesn't Want You to Read !
>
> > Does an extra $500 to $1000 a week sound exciting?
>
> > HINT: It's not what you think
>
> > Dear Friend:
>
> > Everybody is looking to make more money online, but the biggest problem
> > is that VERY few things actually work.
>
> > We have an exclusive system for making money from home and it only
> > requires a few hours a week of your free time.
>
> > Best is. You work once, get paid forever 
>
> > A recent revolutionary discovery has allowed many average people the
ability
> > to create another source of income in their life.
>
>
>
> > For a limited time only, you can receive a FREE copy of your
> > own personal 'hot off the presses' e-book,
> > "How to Achieve Unlimited Freedom: The Confidential Discovery of the
Century"
> > by Dr. Tim Jaeger valued at $19.95 !!
>
>
> > Click Below to receive it
> > absolutely FREE !
>
>
> > Click Here
>
>
>
>
>
>
>
>
>
>
>
> > NOTE - This is NOT SPAM - This message is sent in compliance of the new
e-mail bill: SECTION 301. Per Section 301, paragraph (a)(2)(C) of S. 1618.
This message is NOT Spam as long as you are
> > provided with a way to remove your name from this mailing list. All
further transmissions to you from me may be stopped at no cost to you by
e-mailing [EMAIL PROTECTED] from your e-mail
> > address with the word REMOVE in the subject line.  This e-mail must be
from or contain the address you wish to have removed.
>
> 
> --
> Adrian
> mailto:[EMAIL PROTECTED]
> www: http://www.planetcoding.net
> www: http://www.webskyline.de
>
>
>
> --
> 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



Re: [PHP] Link acting as a submit button

2003-07-25 Thread skate
what is the javascript on it? sorry, missed the start of the thread...

- Original Message -
From: "Matt Palermo" <[EMAIL PROTECTED]>
To: "Comex" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 1:05 PM
Subject: RE: [PHP] Link acting as a submit button


> Actually, I found out what the problem is.  I have a normal submit button
in
> the same page, however when I take out the submit button, the javascript
code
> works fine.  When I put the submit button back in, I get the error again.
Is
> there a fix for this, or do I need to make the submit button into a link
> instead?
>
> Thanks,
> Matt
>
> >= Original Message From Comex <[EMAIL PROTECTED]> =
> ><[EMAIL PROTECTED]>
> >Matt Palermo:
> >> I just remembered (I'm not sure if it makes a difference) that I am
> >> using frames on this page.  Does this matter at all?  Thanks.
> >>
> >> Matt
> >
> >No, it doesn't... well it shouldn't anyway.  Check the source code of the
> >outputted page.  Is it exactly what you want it to be?  If not, you might
> >want to try using single quotes...
> >
> >
> >
> >--
> >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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] File upload

2003-07-25 Thread skate
could be a problem with the post settings in apache? i know apache sets some
restrictions on the size and what's allowed. can't see how it'd be a linux
problem...

does the file appear in your tmp directory at all?

- Original Message -
From: "Jonas Thorell" <[EMAIL PROTECTED]>
To: "'Peda'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Friday, July 25, 2003 1:03 PM
Subject: RE: [PHP] File upload


> >> maybe you should try $HTTP_POST_FILES?
>
> >I have tryed that too, but nothing happened.
>
> Hm, can't think of whatever else is wrong right
> Now but I just tried out your script on my
> Server just to see, and it outputs the
> Filename alright. So it's nothing wrong
> With your script. Granted, my server is
> Windows/IIS instead of Linux/Apache so
> Maybe there's something wrong with the
> Httpd.conf file somewhere?
>
> /Jonas
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.501 / Virus Database: 299 - Release Date: 2003-07-14
>
>
>
> --
> 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



Re: [PHP] need help

2003-07-24 Thread skate
check out sourceforget.net, lots of web applications on there for hosting
management, and i believe there's a few email applications.

- Original Message -
From: "dan montgomery" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 12:55 PM
Subject: [PHP] need help


> need to know which scripts I can get free or at low cost to create a
hosting site and to make an e-mail site. The e-mail site need two features
one is for free accounts and one is for paid accounts like yahoo.com. But
there is one catch yahoo dosn't give as much space as I will for free I will
be equal to the low end of yahoo.com and for only 4.95 a year you get
unlimited space this of course is unless you have put in info that has
helped create this site. Or gave suggestions so as long as you have gave
suggestions then you will get unlimited e-mail.
>
>
>
> -
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software



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



Re: [PHP] I'm really getting annoyed with PHP

2003-07-23 Thread skate
you could also shove some JavaScript in there if you don't like the way the
PHP header("location:...") function works...


location.href="new_page.php";


of course corrections for my bad syntax as i'm doing this out of my head.
but anyway, just PHP to print that script when you want a redirect after
output has been made, and that should solve your problem...

would be useful to know excatly what your doing tho...

- Original Message -
From: "Beauford.2005" <[EMAIL PROTECTED]>
To: "PHP" <[EMAIL PROTECTED]>
Sent: Thursday, July 24, 2003 8:41 PM
Subject: [PHP] I'm really getting annoyed with PHP


> Yes, I'm still screwing around with this stupid redirection thing, and
> either I'm just a total idiot or there are some serious problems with
> PHP. I have now tried to do it another way and - yes - you guessed it.
> It does not work.
>
> I mean really, it can not be this hard to redirect a user to another
> page. If it is, then I must look into using something else as I just
> can't be wasting days and days on one minor detail that should take 30
> seconds to complete.
>
> If anyone has some concrete suggestion on how to get this to work It
> would be greatly appreciated. In the mean time I have given up on it as
> I am just totally pissed off at it.
>
> TIA
>
>
>
> --
> 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



Re: [PHP] USB Flash Drive

2003-07-23 Thread skate
do a search on autorun.inf, that's the file that autorun's CD's.

although i dunno if it'll work with a USB flash drive... can't hurt to try i
guess...

and as mentioned, this has nothing to do with PHP...

- Original Message -
From: "Digital Directory USA, Inc" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 6:06 PM
Subject: [PHP] USB Flash Drive


I have burned a flash movie onto a Flash USB Drive and need it to Auto Run
it on a PC when as soon as it is inserted into a USB port. Is there any PHP
coding that can help me with this? I need it to auto run on 98, 2000, ME,
XP, Linux. If so, can someone please help me with the code?



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



Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread skate
sorry, i should have also pointed out...

this isn't something that PHP could handle on it's own, well, it COULD, but
you shouldn't. you could write a PHP code to run continuosly in the
background, but people would poke and laugh at you... ideally you have
something to schedule the PHP script to run when you need it, rather than
the PHP script waking up and doing it's stuff when it should...


- Original Message -
From: "skate" <[EMAIL PROTECTED]>
To: "Phil Powell" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 10:23 AM
Subject: Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks


> you could have a look at AINTX, it's a windows port of the *nix cron
>
> alternatively, if you've got a few bucks lying around, go buy yourself a
> really old PC, install *nix on it, and use that to run your scheduled
> cron's. they're much more reliable and obviously, if your not using that
> machine, then there's a much lower chance of anything dying.
>
> if you can't do this, and AINTX doesn't do the job, run a quick google
> search for cron on windows. there's lots of versions ported across...
> - Original Message -
> From: "Phil Powell" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, July 23, 2003 10:13 AM
> Subject: [PHP] I need a PHP alternative to Windows Scheduled Tasks
>
>
> I have concluded that Bill Gates is Satan!
>
> Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on
> the hour every day for eternity to go and run a series of Java files I
wrote
> that connect remotely to a remote server to do remote cleanup of stray XML
> files, etc.; things I cannot do on the remote machine box itself because
> it's remote and I don't have permissions were I physically on the box
> anyway.
>
> However, on 7/18 all 26 of my scheduled tasks stopped running; one of
which
> continuously ran for 4 days straight w/o stopping (nor could I manually
stop
> it).  I deleted the runaway process and recreated it; now not a single one
> of my 26 scheduled Win2000 tasks I created using MS-DOS AT commands work
> (which were working since 7/2).
>
> I am now looking into programmatic alternatives.  I really could use some
> ideas that are practical given my situation.  I'm thinking PHP since I am
> very comfortable with it, were it possible within my bizarre Win2000
> environment, but I need something that will clean those XML files remotely
> on a regular basis, it's important for website maintenance.  Any help
> appreciated.
>
> Thanx
> Phil
>
>
>
>
> --
> 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



Re: [PHP] I need a PHP alternative to Windows Scheduled Tasks

2003-07-23 Thread skate
you could have a look at AINTX, it's a windows port of the *nix cron

alternatively, if you've got a few bucks lying around, go buy yourself a
really old PC, install *nix on it, and use that to run your scheduled
cron's. they're much more reliable and obviously, if your not using that
machine, then there's a much lower chance of anything dying.

if you can't do this, and AINTX doesn't do the job, run a quick google
search for cron on windows. there's lots of versions ported across...
- Original Message -
From: "Phil Powell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, July 23, 2003 10:13 AM
Subject: [PHP] I need a PHP alternative to Windows Scheduled Tasks


I have concluded that Bill Gates is Satan!

Ok, I'm late, but... I have had 26 scheduled tasks that run every hour on
the hour every day for eternity to go and run a series of Java files I wrote
that connect remotely to a remote server to do remote cleanup of stray XML
files, etc.; things I cannot do on the remote machine box itself because
it's remote and I don't have permissions were I physically on the box
anyway.

However, on 7/18 all 26 of my scheduled tasks stopped running; one of which
continuously ran for 4 days straight w/o stopping (nor could I manually stop
it).  I deleted the runaway process and recreated it; now not a single one
of my 26 scheduled Win2000 tasks I created using MS-DOS AT commands work
(which were working since 7/2).

I am now looking into programmatic alternatives.  I really could use some
ideas that are practical given my situation.  I'm thinking PHP since I am
very comfortable with it, were it possible within my bizarre Win2000
environment, but I need something that will clean those XML files remotely
on a regular basis, it's important for website maintenance.  Any help
appreciated.

Thanx
Phil




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



Re: [PHP] Hi

2003-07-23 Thread skate
the poker game is actually really weak anyway...

a pair of 6's shouldn't win anything...

- Original Message -
From: "Rausch Alexandru" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 22, 2003 9:42 AM
Subject: [PHP] Hi


MYSQL problems problems.
I want to install an user login aplicationa on my site, but it is intarely
in FLASH. ( www.poker.club66.ro ).
What do u think?




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



Re: [PHP] Register Globals

2003-07-21 Thread skate
a good editor with a good find and replace tool...

i know dreamweaver MX can do a find and replace for an entire site once
you've defined it.


- Original Message -
From: "Daryl Meese" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 21, 2003 1:17 PM
Subject: [PHP] Register Globals


> I would like to rewrite my scripts to work when register globals is off.
> The problem is that my scripts encompass several thousand files.  Does
> anyone have any suggestions for an effective tool to help in this process?
>
> Daryl Meese
>
>
> --
> 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



Re: [PHP] Mac Address Lookup

2003-07-18 Thread skate
very little chance, a machine won't transmit it's MAC address, that the main
point of the TCP/IP stack is to convert IP address' into MAC address' at
routers and such.

- Original Message -
From: "Ashwin Kutty" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 5:19 PM
Subject: [PHP] Mac Address Lookup


> I am trying to do a lookup of a Mac Address via PHP.  Is there any way to
> do so like gethostbyaddr that gets me the name of a machine?
>
> Thanks.
>
>
> --
> 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



Re: [PHP] omitting the #!

2003-07-18 Thread skate
yeah, your currently running php through cgi on your live server, just
install php as a proper module, and you should be good to go.

you may also be able to stick a header on every page that includes the
#!.  not 100% with this tho, you'll have to have a look into it...


- Original Message -
From: "Rob Day" <[EMAIL PROTECTED]>
To: "'PHP Users'" <[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 4:49 PM
Subject: [PHP] omitting the #!


> First of all, I apologize if I'm asking a question with an obvious answer.
>
> I do my php development on a Windows 2000 machine. Whenever I move php
apps
> to the production server I have to add the path to php (#!/usr/bin/php) to
> the top of every php file. Is there some way I can configure the Apache or
> PHP so that I don't need to do this anymore? The server is Red Hat Linux
9.0
> with Apache 2.0.40 and PHP 4.2.2. Thanks.
> -Rob
>
> --
> 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



Re: [PHP] Still problem with files

2003-07-18 Thread skate
have you tried \r\n ?

- Original Message -
From: "Beauford.2005" <[EMAIL PROTECTED]>
To: "'Curt Zirzow'" <[EMAIL PROTECTED]>; "'PHP'"
<[EMAIL PROTECTED]>
Sent: Thursday, July 17, 2003 3:40 PM
Subject: RE: [PHP] Still problem with files


> For whatever reason your suggestions still caused me problems, but I did
> come up with a solution that works.
>
> if (preg_match ("/Alfredsson/", $buffer))
>
> Another question though regarding \n. What I'm doing here is reading the
> file, omitting one entry, adding another, and saving it back to the
> file. When I add the entry and save it back to the file it appears
> beside the last entry instead of below it. How do I get it so it is
> below it. I have tried using a \n but no go. I am probably missing
> something, but not sure what. This is the first time I've played with
> files in PHP.
>
> i.e.
>
> Roy, P
> Theodore
> ThibaultWorrel
>
> -Original Message-
> From: Curt Zirzow [mailto:[EMAIL PROTECTED]
> Sent: July 18, 2003 1:50 AM
> To: PHP
> Subject: Re: [PHP] Still problem with files
>
>
> Curt Zirzow <[EMAIL PROTECTED]> wrote:
> > Beauford.2005 <[EMAIL PROTECTED]> wrote:
> > >
> > > i.e
> > >
> > > $p = "Alfredsson";
>
> And watch out for case sensitive issues
>  'Option' != 'option'
>
> Curt
> --
>
> --
> 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 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 skate
the sendmail_path in php.ini is to do with where abouts the sendmail program
is located, not where your sending mail from...

if you define the extra headers in the mail, such as FROM and REPLY-TO, you
shouldn't have any problems. basically, it's just like fake-mail, and your
recipient should be none-the-wiser unless he really wants to sift through
the headers.


- Original Message -
From: "Brian S. Drexler" <[EMAIL PROTECTED]>
To: "'CPT John W. Holmes'" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Friday, July 18, 2003 4:10 PM
Subject: RE: [PHP] Mail From option in PHP.ini


> 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 General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



re: [PHP] Zip to postcode

2003-04-02 Thread skate
sorry, don't have anything to add for code, but just a note to remember that UK post 
codes can also be in the form...

QQ11 1QQ
Q1 1QQ
Q11 1QQ
QQ1 1QQ

so it's a real pain to write an expression for this...

-skate-




Can someone please tell me how i change the following code:
if (!ereg("^[0-9]{5,5}(\-[0-9]{4,4})?$",$postcode))

to a UK postcode QQ1 1QQ
When i fill out the form it tells me that the postcode is not valid and i
think it is because it is in zip code format.

Thank you

Andy



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



Re: [PHP] Php.ini doesn't exit

2003-04-02 Thread skate
you can set _some_ directives directly in php

check the manual for the set ini options, can't remember the exact
function...

php will work without an .ini file, but will have all defaults set. again,
check thru the manual to see what the defaults are.

- Original Message -
From: "Javier Carreras" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 11:01 AM
Subject: [PHP] Php.ini doesn't exit


> Hi all,
>
> Where does PHP get its settings if php.ini file doesn't exist?
>
> BTW- I want to enable sockets that are not enabled. Could I do that
without
> creating a php.ini file?
>
> Regards,
> Javi.
>
>
> --
> 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



Re: [PHP] Newbie

2003-04-02 Thread skate
could this not also be solved by switching register_globals as on? reading
through the error, it looks like that's what it's complaining about. there
is security risks to turning this on, which is probably why it doesn't
suggest doing it, but depends how secure you need your site to be? and also
how much you want to check the security and patch it up if necessary?

- Original Message -
From: "Burhan Khalid" <[EMAIL PROTECTED]>
To: "Ilyas" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 02, 2003 10:04 AM
Subject: Re: [PHP] Newbie


> Ilyas wrote:
> > Hi all
> >
> > I downloaded the oscommerce online shop. I have no experience with php.
> > I installed yesterday php 4.3.
> >
> > Just my question: I get this error if I call the startpage of this shop:
> >
> > Warning: Unknown(): Your script possibly relies on a session side-effect
> > which existed until PHP 4.2.3. Please be advised that the session
> > extension does not consider global variables as a source of data, unless
> > register_globals is enabled. You can disable this functionality and this
> > warning by setting session.bug_compat_42 or session.bug_compat_warn to
> > off, respectively. in Unknown on line 0
>
> You have two options :
>
> 1. turn off warnings
> 2. edit the php.ini settings as it states "by setting ..."
>
> --
> Burhan Khalid
> phplist[at]meidomus[dot]com
>
>
>
> --
> 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



Re: [PHP] Array Question

2003-04-01 Thread skate
look into things like JOIN and SORT BY in MySQL, they're quicker and more efficient 
than PHP for doing DB stuff (so i'm told)

took me awhile to get my head around JOIN, but once you've got it, you'll never be 
without it ;)


"Mark McCulligh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> I have two tables that I want to display together as if they were one table
> and order them by a common date field.
> 
> Because I am using MySQL I can't use the usually way I would do this. Create
> a store procedure or view.
> 
> I was thinking of creating two separate queries in PHP then loading the data
> into one Array. In short loop though both tables copying the records into an
> array.
> 
> Then I was going to sort the Array my a common date field. Then of course
> loop through printing the Array.
> 
> My question is: Is this the best way to do this or is there another way.
> Also how can you sort an Array by one date field.
> 
> Any ideas on how to do link two tables together and sort my a common date
> field.
> 
> Thanks,
> Mark.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

Re: [PHP] question

2003-03-30 Thread skate
ahkay, makes perfect sense now :)

thanks
- Original Message -
From: "Don Read" <[EMAIL PROTECTED]>
To: "skate" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 2:19 PM
Subject: Re: [PHP] question


>
> On 30-Mar-2003 skate wrote:
> > excuse me for being dumb, but can you explain this line for me?
> >
> > if (! (++$i % 2))
> >
>
> If $i is evenly divisible by 2 then ($i % 2) evaluates to 0 or (false).
> The (! ($i % 2)) inverts the meaning to (true) so the statements within
> the if block are executed.
>
> The ++$i bit --well it's a handy spot to increment $i, and the
pre-increment
> notation gets around the case when $i == 0.
>
> Regards,
> --
> Don Read   [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>steal the neighbor's newspaper, that's the time to do it.
>
> --
> 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



Re: [PHP] question

2003-03-30 Thread skate
excuse me for being dumb, but can you explain this line for me?

if (! (++$i % 2))

i've done scripts like this before, but never used anything like this? but
then i never was a great coder :)

thanks

- Original Message -
From: "Don Read" <[EMAIL PROTECTED]>
To: "Marius" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Sunday, March 30, 2003 1:54 PM
Subject: RE: [PHP] question


>
> On 30-Mar-2003 Marius wrote:
> >   >  $i = 0;
> >  $list = array('Banana', 'Strawberry', 'Apple', 'Cherry');
> >  echo $list[$i];
> >  $i = $i+1;
> >  ?>
> >
> >  how to do that 2 of key echoes in first table colum and other 2 in
> >  second colum?
> >
>
> Method 1:
>
> $i=0;
> echo '
> foreach($list as $v) {
>
> echo $v, '';
> if (! (++$i % 2))
> echo '';
> if ($i < count($list))
>  echo '';
> }
> }
> echo '';
>
>
> Method 2:
>
> echo '';
> unset($blk);
> foreach($list as $v) {
> if (count($blk) >= 2) {
> echo '', implode('', $blk), '';
> unset($blk);
> }
> $blk[] = $v;
> }
> 
> if (count($blk) )
>  echo '', implode('', $blk), '';
> echo '';
>
>
> Regards,
> --
> Don Read   [EMAIL PROTECTED]
> -- It's always darkest before the dawn. So if you are going to
>steal the neighbor's newspaper, that's the time to do it.
>
> --
> 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



Re: [PHP] Passing data between the web to an Intranet

2003-03-26 Thread skate
as another solution (and not knowing mysql replication myself, so can't
comment on this) you could connect remotely to your MySQL database that is
on your intranet, and dump the data straight into it. it really depends how
open to the world that system is, or can be, and how security concious you
are.

or you could have some kinda XML output or DB dump from the online website
available, and have your local CRM machine access that every 5 minutes or
less...

just 2 other solutions, maybe not the best, but they'd do the job...


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 26, 2003 10:53 AM
Subject: Re: [PHP] Passing data between the web to an Intranet


> On Wednesday 26 March 2003 16:40, Steve Jackson wrote:
>
> > Sorry. What I mean is that we have an externally hosted website.
> > Currently all the forms etc update tables in the web hosted mysql DB. I
> > am in the process of building a small CRM system and want the data to
> > drop into our non public domain Intranet server. Is this possible?
>
> OK. Yes, some of the possible solutions are as below:
>
> > > > I am thinking down one of three lines.
> > > > 1) I use PHP to send an email with the data in it and update our
> > > > internal DB manually (the worst case)
> > >
> > > Can be done pretty easily.
> >
> > I know but I don't want to have to manually update data from emails to
> > our Intranet server.
>
> Manually? What I meant was that it's pretty easy to send an email to a
server
> and have a script process the email. Thus the script will parse the
contents
> of the mail and update the db accordingly. Search the archives for
"process
> mail", I have some old posts which outline how this can be done.
>
> > > > 2) I use PHP which takes data, sends it as an email, puts it into a
> > > > form which then automatically updates our internal network
> > > > (interesting idea but I have no clue if it can be done ;o)
> > >
> > > Not sure what you mean here. How is it different from the above?
> >
> > I was thinking that I may be able to *automatically* take the data from
> > emails and put them through a form (hosted internally) which would then
> > update our DB here. I just don't know whether it's possible to do or
> > where to start.
>
> See above.
>
> > > > 3) I use some sort of synchronisation so every time the web DB is
> > > > updated our internal one is also updated (ideal).
> > >
> > > See mysql replication.
> > >
> > > > I would welcome any other ideas or solutions. Does mysql have any
> > > > replication or synchronisation functions? I am told Oracle has but
> > > > haven't seen this or heard of this with mysql.
> > >
> > > Did you actually do any research? I'm sure if you google for "mysql
> > > replication" or "mysql synchronisation" you would get
> > > thousands of hits.
> >
> > Yes I did but am not really understanding it which is why I asked here.
> > Sorry if that offends you.
>
> With all due respect that is not what you asked. In any case for help on
> mysql's replication feature you should ask on the mysql list.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> --
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> --
> /*
> does your DRESSING ROOM have enough ASPARAGUS?
> */
>
>
> --
> 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



Re: [PHP] Persistent connections with mysql_pconnect()

2003-03-25 Thread skate
no, not at all... but there is a time and a place, and i don't think you
should use pconnect just because you don't want to an include at the top of
every page.

- Original Message -
From: "John Hicks" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, March 25, 2003 5:11 PM
Subject: [PHP] Persistent connections with mysql_pconnect()


> On Tuesday 25 March 2003 09:02 am, "skate" <[EMAIL PROTECTED]> wrote:
> > leaving the connection open creates security questions,
> > and also leaves resources open, what if a user closes his
> > browser window, how do you know to close the connection?
>
> So are you saying that persistent connections  [ i.e. mysql_pconnect() ]
> should never be used?
>
> > if you really want to make it simple, you can edit your
> > php.ini to have the username and password as default in
> > there, but again, this can be a security risk.
> >
> > i'm afraid the best way is to include connection code on
> > every page...
>
> --
> 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



Re: [PHP] connecting to mysql db

2003-03-25 Thread skate
leaving the connection open creates security questions, and also leaves resources 
open, what if a user closes his browser window, how do you know to close the 
connection?

if you really want to make it simple, you can edit your php.ini to have the username 
and password as default in there, but again, this can be a security risk.

i'm afraid the best way is to include connection code on every page...

-- 
skate - fatcuban.com
"Iggy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> This really doesn't explain me much. I mean the difference between having
> that code on every page or calling it from an external page doesn't tell me
> if it is realy necessary to do it all the time. I guess I am looking for
> more generic explanation of the whole process rather than what you said.
> 
> However I appreciate it much, since it seems to be much better coding
> practice
> 
> Iggy
> 
> 
> 
> "Randy Rankin" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Place the code in a file ( ie; dbcon.php ) and include that file in any
> page
> > which may need it using an include statement: include("dbcon.php");
> >
> > Randy
> >
> > -Original Message-
> > From: Iggy [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, March 25, 2003 7:50 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] connecting to mysql db
> >
> >
> > hi,
> > I am trying to play and learn php along with mysql and I have a question
> > about connecting to a db.
> > Is the following code necessary on every php page where I am retrieving
> some
> > data from a db or is there any way to connect once (something like
> > index.php) and have that connection open through subsequent pages?
> > the code
> >  > $link = mysql_connect("localhost", "", "")
> > or die("Could not connect: " . mysql_error());
> > print ("Connected successfully");
> >
> > mysql_select_db("test")
> > or die("Could not select database: " . mysql_error());
> > ?>
> >
> > thanx
> > iggy
> >
> >
> >
> > --
> > 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
> 
> 
> 

Re: [PHP] substr() on part an ereg() capture

2003-03-25 Thread skate
couldn't you just do substr( $blah, 0, 55)

or something similar?

(i'm crap with syntax, so that's just off my head...)


-skate-
fatcuban.com


- Original Message -
From: "Justin French" <[EMAIL PROTECTED]>
To: "php" <[EMAIL PROTECTED]>
Sent: Tuesday, March 25, 2003 1:24 PM
Subject: [PHP] substr() on part an ereg() capture


> Hi, I have this ereg to turn URLs into links:
>
> eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", " href=\"\\1://\\2\\3\" {$t}\">\\1://\\2\\3", $str);
>
> ... found it in the manual i think, or maybe on weberdev.com examples
>
>
> Anyhoo, it places the whole link in between the  and , which is
> fine for short links, but on longer links (in my case, around 60+ chars),
it
> messes with my table or CSS layout.
>
> So, I'd like to subtr() the 2nd capture part down to 55 chars or something
> IF it's longer than 60, and append a ... to it.
>
> ANY ideas on how this is done?  Or is this beyond regexp??
>
>
> TIA
>
> Justin
>
>
> --
> 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