[PHP] "What date/time was it 7 hours ago"?

2002-04-15 Thread Torkil Johnsen

"What date/time was it 7 hours ago"?

I'm just trying to make a log using mysql/php
This log is kinda supposed to show the time, local to the user.

So I store datetime on the format -MM-DD HH:MM:SS in a datetime field.
Using the php date function to get the date.

This will store the time that right then ON THE SERVER.

Now, when fetching data from the mysql table, I want to display what the
time WAS, LOCALLY (where I'm at, not the server) when the log entry was
made.

So. How do I make a function that takes in -MM-DD HH:MM:SS and spits out
the -MM-DD HH:MM:SS minus... for instance, 7 hours?

"What date/time was it 7 hours ago"?



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




[PHP] Session problem

2002-04-15 Thread Torkil Johnsen

I get this errormessage when trying to make my logon work:

Warning: Cannot send session cache limiter - headers already sent
(output started at /path/to/my/little/session.inc:9) in
/path/to/my/little/session.inc on line 10

line 10 contains: session_start();


It does however seem like I am "logged in", becase at the bottom of my page,
my logout button is appearing. (which it is only supposed to do if
"session_is_registered(session_id)"

When clickign the logout button I get this message:
Warning: Trying to destroy uninitialized session in
/path/to/my/little/session.inc on line 37

Where line 37 says:session_destroy();

Anyone...?
Anyone have any links to any really good php session examples? I have read
quite a few of them now...


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




[PHP] Php/Mysql

2002-04-12 Thread Torkil Johnsen

Just a noob php/mysql question... (I suppose)

When I try just putting php code in my insert queries, it goes like this:

insert into mytable values('')

select * from mytable, returns:
Some string

So the insert-query inserts both the code AND the string that the code
echoes...

Any help would be greatly appreciated!


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




[PHP] Problem with backslashes disappearing

2002-03-06 Thread Torkil Johnsen

Hello!

I have a simple form taking in some user text input and storing it in a
mysql database. My problem is that PHP strips off any backslashes in the
text. I realize that backspace is used as an escape character in PHP, but
sometimes i DO want it in there!!

Is there a way to do this so that I can store them? For example replacing
the backslash with some code? Like "&" can replace "&"?

Anyone?

- Torkil


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




[PHP] Text editor for linux

2002-02-16 Thread Torkil Johnsen

Anyone know of a good text editor for linux, WITH syntax highlighting for
php/html + other languages?

- TOrkil


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




[PHP] Date & time

2002-01-29 Thread Torkil Johnsen

Hello...

I have a field in my mysql database containing date&time on the format
-MM-DD HH:MM:SS (24-hour format)

Now. I want to output this as follows: DD.MM.YY at HH:MM:SS
Currently I do this by this function:

function convert_datetime($in){
$return = substr($in,8,2) . "." . substr($in,5,2) . "." . substr($in,2,2) .
" at " . substr($in,11,8);
return $return;
}

Is there a better way? Either with mysql or php?
Now. Another problem. Since my webserver is in the states, and I live in
Norway, I get a 7 hour time difference.

So when I do date("Y-m-d H:i:s") I get a time that is 7 hours wrong.
Any idea as to how I can correct this to be 7 hours later (that is: 12 in
server time is really 19 where I live) in an easy way?

THanks in advance,
Torkil


-- 
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] Building my site... again

2002-01-25 Thread Torkil Johnsen

I started my HTML career back in the days when the newest MS Word-version
came with a "save as html"-function. I saved as HTML, read the code, and
learned by myself bit by bit. By the time I got my hands on HTML for
dummies, I realized I was no dummy after all :) But now, asking this, I feel
kinda dumb...

Its got to do with PHP, search engines, meta-tags and headers.

I am building my site like this:

- I have an index.php-file, that takes two variables, page and subpage. A
link on my site may look like this:
 (for instance)

Now, my index.php-file will do this: (basically)


if($page){
include($page . ".inc");
}



and my cars.inc will do this:

if($subpage){
include($subpage . ".inc");
}

Now. I would of course like for my site to be listed in the search engines,
and I wouldn't mind getting search hits on both cars and ferrari. But. Will
the web spiders and web crawlers ever follow a link like
index.php?page=cars&subpage=ferrari and will they ever index what they find
there, and, and, and, and...

Well... does anyone understand what I'm asking here? WOuld this be a good
way to build my site to ensure getting hits from search engines, or should I
do this some other way? Anyone know?

- Torkil


-- 
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] Changing form look without reloading

2002-01-17 Thread Torkil Johnsen

Hello...

I am wondering: Would it be possible to:
1) Select an option in a selectbox
2) Have a list of checkboxes pop up underneath the selectbox, based on what
you selected
3) Without reloading the page...

Show/hide layers I can figure out myself... I dont want to have X hidden
layers with X times 10 checkboxes within each of them.

Suggestions AND CODE snipplets very welcome!

Sincerely,
- Torkil


-- 
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] To you know-it-all's out there...

2002-01-05 Thread Torkil Johnsen

Yeah this is a BIT of topic...

I have this code:
');
?>



http://www.w3.org/TR/2000/03/WD-SVG-2303/DTD/svg-2303-stylable.dtd";
>


Using styles




See for yourself at:
http://www.torkiljohnsen.com/xperiment/index.psvg

This produces an error message (which you can read at the same page).

Why is this?
I had an xml/svg "specialist" make this code and it works perfectly on his
server... Anyone got ANY clue as to why this is happening?

ehhh... does anyone know of any good XML/SVG mailing lists out there ? :S

Didn't know where else to ask.

 - Torkil


-- 
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] How to compute time to load page...

2001-12-08 Thread Torkil Johnsen

Hi All... (again)

I was just wondering if anyone out there has made a function that will
compute how long time (seconds, milliseconds) it will take to load a page?

I see some search engines have a function that displays how long time the
search took, and I'm looking for the same thing, to compare different
designs and improve loading time for my "viewers".

Anyone?
- Torkil Johnsen


-- 
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] How do I check GD version?

2001-12-08 Thread Torkil Johnsen

Cheers all...

This mail got rather long, so here are my 3 questions in a short version:
1) What is GD? (fore use with imagecopyresampled function)
2) How can I run a function that will tell me what version of GD is
installed on my server, if any version at all?
3) Anyone know of some good hosts out there which has got all of this under
control? (basically people who has a clue about what they're doing)



The long version:
As many of us I am buying my hosting services and paying a monthly sum for
it. (sigh... yes) I am working on using a function to make thumbnails out of
uploaded images, and I see from the php manual that many of those have been
made already.

I can also read that ImageResample gives a much better result than
ImageResized. (ImageCopyResampled and ImageCopyResized maybe the names
were...)

I also see that I need something called GD to use the resampled function.
Well I tried searching the php site for some clue as to what GD is. I didn't
find much there (hard to search when the query is shorter than 3 letters).

So I was looking for a brief explenation as to what GD is.

Also: Could anyone point me in the direction of a function that would tell
me if my server has this GD thing installen and if it does: What version it
is running.

Just like PHP has its version info function...

Its so much easier than writing those damn hosting people and ask them. They
might not even know

And on that subject: Anyone know of some really good hosts out there which
has got some clue as to how to set up a server properly and how to ... ehem
... fulfill every clients little needs :) ??

Lots of questions? heh. So I wrote a short version on the top.

- Torkil


-- 
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] Searching when using language specific characters

2001-12-04 Thread Torkil Johnsen

Note to Kurt Lieber: Stop whining about topics that have been discussed
already. If this topic has been up before, just don't open it eh?

Anyways:
I have a register with lots of names in it, names which in some cases
contain characters that can not be found in the ordinary english aphabet.
Norwegian characters like æ, ø and å.

Sorting these is not working, so I was wondering if someone had a neat
little solution for this? And yes: Its MySQL :) I am guessing I have to do
something with the character set... Can I set the char set from the webpage
where I'm calling the search or...?

- Torkil


-- 
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] Drawing line onto an image

2001-11-10 Thread Torkil Johnsen

Hello.

I'm looking for sample code on how I can solve this problem:

 - I have a webpage.
 - On the webpage I have a map. (gif image)
 - I have two points on the map: a and b, with coordinates ax,ay and bx,by
 - Now... I want to create a straight line that is drawn from a to b, and I
want this line to be displayed on top of the map.

So I want to make a php-generated line that is drawn upon a gif.
Maybe it is possible to draw this line inside a layer that is placed upon
the webpage with a higher z-index that that of the map gif?

... any clever minds out there?

Thanks in advance,
Torkil Johnsen



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