[PHP] stripping spaces from a string

2002-12-06 Thread Jule Slootbeek
Hi,

What's the best and easiest way to strip all the spaces from a string? 
do i use regular expressions for it?

TIA,
J.
Jule Slootbeek
[EMAIL PROTECTED]


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



Re: [PHP] Re: stripping spaces from a string

2002-12-06 Thread Jule Slootbeek
perfect, exactly what i needed
thanks

J.
On Friday, Dec 6, 2002, at 16:38 US/Eastern, J Smith wrote:



Regular expressions would be overkill. Try

$newString = str_replace( , , $oldString);

J


Jule Slootbeek wrote:


Hi,

What's the best and easiest way to strip all the spaces from a string?
do i use regular expressions for it?

TIA,
J.
Jule Slootbeek
[EMAIL PROTECTED]



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



Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] MySQL-port question

2002-11-21 Thread Jule Slootbeek
I have a problem,
i know this is not the MySQL mailinglist, but i hope you guys can help 
me.
when i type mysqladmin variables the port comes up as 0 and doesn't let 
people connect to my db remotely.
does anyone know why this problem is, and how i can change my port?

TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]


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



Re: [PHP] ftp file exists

2002-11-08 Thread Jule Slootbeek
if there's no function to check (which i can;t find real quick) do 
soething like this:

if (!ftp_mdtm($conn_id, $file) {
	echo File doesn't exist;
} else {
	echo File exist;
}

On Friday, Nov 8, 2002, at 12:01 US/Eastern, Fifield, Mike wrote:

How do you check if a file exists a remote ftp site.



Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] filemtime() error

2002-11-06 Thread Jule Slootbeek
Hi,
i'm writing a piece of code that allows me to upload the updated 
version of my website from the local tree, to the server.
I do this by comparing the linux timestamps on the local and remote 
files.
printing a table of the remote files works fine, but when i do it for 
my local files, i get an error for every file:

Warning: stat failed for bandhistory.html (errno=2 - No such file or 
directory) in /Users/jslootbe/Sites/upload.php on line 71

except for the index.php which just gives me a normal timestamp.
this is a dump of the dir:

total 232
drwxr-xr-x  25 jslootbe  staff850 Nov  6 11:20 .
drwxr-xr-x  11 jslootbe  staff374 Nov  6 13:59 ..
-rwxr-xr-x   1 jslootbe  staff  15364 Nov  2 16:11 .DS_Store
-rwxr-xr-x   1 jslootbe  staff519 Oct 20 20:15 band.php
-rwxr-xr-x   1 jslootbe  staff   2034 Oct 23 00:56 bandhistory.html
-rwxr-xr-x   1 jslootbe  staff   1021 Nov  5 21:50 blindtheory.sql
-rwxr-xr-x   1 jslootbe  staff   1016 Nov  5 21:32 blindthoery.sql
-rwxr-xr-x   1 jslootbe  staff322 Oct  8 19:08 colors.inc.php
-rwxr-xr-x   1 jslootbe  staff146 Oct  8 19:08 contact.php
-rwxr-xr-x   1 jslootbe  staff   2266 Nov  5 00:13 dates.php
-rwxr-xr-x   1 jslootbe  staff188 Oct  8 19:08 globals.inc.php
-rwxr-xr-x   1 jslootbe  staff194 Oct  9 20:35 
globals.inc.php-online
-rwxr-xr-x   1 jslootbe  staff  4 Oct  9 20:32 home.php
-rwxr-xr-x   1 jslootbe  staff   3376 Oct 30 21:21 index.php
-rwxr-xr-x   1 jslootbe  staff   5851 Nov  6 11:20 interaction.php
-rwxr-xr-x   1 jslootbe  staff   2958 Nov  5 00:16 layout.php
drwxr-xr-x  18 jslootbe  staff612 Oct 19 13:55 lyrics
-rwxr-xr-x   1 jslootbe  staff   1457 Oct 25 20:42 lyrics.php
-rwxr-xr-x   1 jslootbe  staff   2578 Oct 25 20:32 media.php
-rwxr-xr-x   1 jslootbe  staff815 Nov  5 00:18 misc.inc.php
-rwxr-xr-x   1 jslootbe  staff   1370 Oct 20 19:39 news.php
-rwxr-xr-x   1 jslootbe  staff 21 Oct  8 22:39 phpinfo.php
drwxr-xr-x   7 jslootbe  staff238 Oct 10 12:38 pics
-rwxr-xr-x   1 jslootbe  staff148 Oct  8 19:08 template.php
-rwxr-xr-x   1 jslootbe  staff   1064 Nov  3 18:53 todo.list

and here's the code.

$localDir = /Users/jslootbe/Sites/blindtheory;
	
if ($opendir = opendir($localDir)) {
	while ($localList = readdir($opendir))
   	{
   		if ($localList != .  $localList != ..) {
   echo 	tr
   			td.$localList./td
   			tdmodified/td
   			td.filemtime($localList)./td
   		/tr;	
   		}
  	}
  	closedir($opendir);
}

does anyone have any idea why it won't show a stamp for every file?

TIA,
Jule
Jule Slootbeek
[EMAIL PROTECTED]

[PHP] sql error

2002-11-05 Thread Jule Slootbeek
I know this is the wrong mailinglist, but i don't want to subscribe to 
a second one for one random question.

when trying to enter this into my db:

DROP TABLE IF EXISTS dates;
CREATE TABLE dates (
  id int(10) unsigned NOT NULL auto_increment,
  date varchar(50) NOT NULL default '',
  at varchar(50) NOT NULL default '',
  where varchar(255) NOT NULL default '',
  with varchar(255) NOT NULL default '',
  whereURL varchar(100) NOT NULL default '',
  info varchar(255) NOT NULL default '',
  PRIMARY KEY  (id)
) TYPE=MyISAM;

(this is generated by phpMyAdmin)

i get this error:

ERROR 1064 at line 18: You have an error in your SQL syntax near 'where 
varchar(255) NOT NULL default '',
  with varchar(255) NOT NULL default '',' at line 5

where's the error?
i don't see anything wrong..

TIA,

Jule

Jule Slootbeek
[EMAIL PROTECTED]


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



Re: [PHP] sql error

2002-11-05 Thread Jule Slootbeek
Ah i see, but then why will phpMyAdmin let me use it?
it works fine on my local db with these names, but on my remote server 
it refuses to create the table.

Jule

On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:

where is a reserved keyword in SQL--try changing the name of that
column to something else.


Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek wrote:


I know this is the wrong mailinglist, but i don't want to subscribe to
a second one for one random question.

when trying to enter this into my db:

DROP TABLE IF EXISTS dates;
CREATE TABLE dates (
   id int(10) unsigned NOT NULL auto_increment,
   date varchar(50) NOT NULL default '',
   at varchar(50) NOT NULL default '',
   where varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',
   whereURL varchar(100) NOT NULL default '',
   info varchar(255) NOT NULL default '',
   PRIMARY KEY  (id)
) TYPE=MyISAM;

(this is generated by phpMyAdmin)

i get this error:

ERROR 1064 at line 18: You have an error in your SQL syntax near 
'where
varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',' at line 5

where's the error?
i don't see anything wrong..

TIA,

Jule

Jule Slootbeek
[EMAIL PROTECTED]






Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] sql error

2002-11-05 Thread Jule Slootbeek
apparently 'where' and 'with' are keywords in Java, i've changed them 
and now it works fine.
thanks!

Jule

On Tuesday, Nov 5, 2002, at 21:53 US/Eastern, Marco Tabini wrote:

I'm not entirely sure... different configurations perhaps? Have you
verified that that's indeed the problem?

Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek
wrote:


Ah i see, but then why will phpMyAdmin let me use it?
it works fine on my local db with these names, but on my remote server
it refuses to create the table.

Jule

On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:


where is a reserved keyword in SQL--try changing the name of that
column to something else.


Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek wrote:


I know this is the wrong mailinglist, but i don't want to subscribe 
to
a second one for one random question.

when trying to enter this into my db:

DROP TABLE IF EXISTS dates;
CREATE TABLE dates (
   id int(10) unsigned NOT NULL auto_increment,
   date varchar(50) NOT NULL default '',
   at varchar(50) NOT NULL default '',
   where varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',
   whereURL varchar(100) NOT NULL default '',
   info varchar(255) NOT NULL default '',
   PRIMARY KEY  (id)
) TYPE=MyISAM;

(this is generated by phpMyAdmin)

i get this error:

ERROR 1064 at line 18: You have an error in your SQL syntax near
'where
varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',' at line 5

where's the error?
i don't see anything wrong..

TIA,

Jule

Jule Slootbeek
[EMAIL PROTECTED]






Jule Slootbeek
[EMAIL PROTECTED]







Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] sql error

2002-11-05 Thread Jule Slootbeek
possible, but wouldn't phpMyAdmin export the name with the tick marks??

CREATE TABLE foo (`where` varchar(255) NOT NULL);

Jule

On Tuesday, Nov 5, 2002, at 21:51 US/Eastern, John W. Holmes wrote:


PHPMyAdmin may put tick marks around the name, which will get rid of 
the
error.

`where` varchar(255) not null ...

---John Holmes...

-Original Message-
From: Jule Slootbeek [mailto:jslootbeek;clarku.edu]
Sent: Tuesday, November 05, 2002 9:43 PM
To: Marco Tabini
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sql error

Ah i see, but then why will phpMyAdmin let me use it?
it works fine on my local db with these names, but on my remote server
it refuses to create the table.

Jule

On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:


where is a reserved keyword in SQL--try changing the name of that
column to something else.


Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek wrote:


I know this is the wrong mailinglist, but i don't want to subscribe

to

a second one for one random question.

when trying to enter this into my db:

DROP TABLE IF EXISTS dates;
CREATE TABLE dates (
   id int(10) unsigned NOT NULL auto_increment,
   date varchar(50) NOT NULL default '',
   at varchar(50) NOT NULL default '',
   where varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',
   whereURL varchar(100) NOT NULL default '',
   info varchar(255) NOT NULL default '',
   PRIMARY KEY  (id)
) TYPE=MyISAM;

(this is generated by phpMyAdmin)

i get this error:

ERROR 1064 at line 18: You have an error in your SQL syntax near
'where
varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',' at line 5

where's the error?
i don't see anything wrong..

TIA,

Jule

Jule Slootbeek
[EMAIL PROTECTED]







Jule Slootbeek
[EMAIL PROTECTED]


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





Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] sql error

2002-11-05 Thread Jule Slootbeek
did I say Java? oops, i meant SQLlearning Java in my comp sci 
class..(=
forgive me.

Jule

On Tuesday, Nov 5, 2002, at 21:54 US/Eastern, Martin Towell wrote:

where is a java keyword ? have you got an example ?
It's been _ages_ since I've done any code in java :(

-Original Message-
From: Jule Slootbeek [mailto:jslootbeek;clarku.edu]
Sent: Wednesday, November 06, 2002 1:52 PM
To: Marco Tabini
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] sql error


apparently 'where' and 'with' are keywords in Java, i've changed them
and now it works fine.
thanks!

Jule

On Tuesday, Nov 5, 2002, at 21:53 US/Eastern, Marco Tabini wrote:


I'm not entirely sure... different configurations perhaps? Have you
verified that that's indeed the problem?

Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek
wrote:


Ah i see, but then why will phpMyAdmin let me use it?
it works fine on my local db with these names, but on my remote 
server
it refuses to create the table.

Jule

On Tuesday, Nov 5, 2002, at 21:47 US/Eastern, Marco Tabini wrote:

where is a reserved keyword in SQL--try changing the name of that
column to something else.


Marco

---
php|architect -- The Monthly Magazine For PHP Professionals
Visit us on the web at http://www.phparch.com!

On Tue, 5 Nov
2002, Jule Slootbeek wrote:


I know this is the wrong mailinglist, but i don't want to subscribe
to
a second one for one random question.

when trying to enter this into my db:

DROP TABLE IF EXISTS dates;
CREATE TABLE dates (
   id int(10) unsigned NOT NULL auto_increment,
   date varchar(50) NOT NULL default '',
   at varchar(50) NOT NULL default '',
   where varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',
   whereURL varchar(100) NOT NULL default '',
   info varchar(255) NOT NULL default '',
   PRIMARY KEY  (id)
) TYPE=MyISAM;

(this is generated by phpMyAdmin)

i get this error:

ERROR 1064 at line 18: You have an error in your SQL syntax near
'where
varchar(255) NOT NULL default '',
   with varchar(255) NOT NULL default '',' at line 5

where's the error?
i don't see anything wrong..

TIA,

Jule

Jule Slootbeek
[EMAIL PROTECTED]







Jule Slootbeek
[EMAIL PROTECTED]







Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
hey

is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't know 
where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA

Jule
Jule Slootbeek
[EMAIL PROTECTED]


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



Re: [PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
i thought fopen() was only for local files, didn't even bother looking, 
but now i think about it..it makes perfect sence to open url's as well, 
thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't know 
where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] getting HTML header from URL

2002-11-01 Thread Jule Slootbeek
well, i got it to read a html file, but the problem is that it reads it 
after it loads it, so it doesn't read the tags, and i'm looking for the 
string in between title and /title
is there a way using fopen()  or something similar to read an html/php 
file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too i 
can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
hmm, figured it out...all of a sudden it did work:
here's the code, it loads a URL and returns the title...
dunno what it would be used for, but it aught we some more about php..
i'll probbly implement it on a link page ir something

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
return $rline;
fclose($file);
break;
			}
	}
	fclose($file);
}


On Friday, Nov 1, 2002, at 20:26 US/Eastern, Jule Slootbeek wrote:


well, i got it to read a html file, but the problem is that it reads 
it after it loads it, so it doesn't read the tags, and i'm looking for 
the string in between title and /title
is there a way using fopen()  or something similar to read an html/php 
file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too 
i can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
oops didn't catch two little bugs

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
//return $rline;
//fclose($file);
break;
			}
	}
	return $rline;
}
	fclose($file);
}

On Friday, Nov 1, 2002, at 20:35 US/Eastern, Jule Slootbeek wrote:


hmm, figured it out...all of a sudden it did work:
here's the code, it loads a URL and returns the title...
dunno what it would be used for, but it aught we some more about php..
i'll probbly implement it on a link page ir something

Jule

function getTitle($url)
{
	$file = @fopen($url, 'r');

	if(!$file) {
		$rline = Error, contact webmaster;
	} else {
		while (!feof ($file)) {
 			$line = fgets($file);
 			if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
return $rline;
fclose($file);
break;
			}
	}
	fclose($file);
}


On Friday, Nov 1, 2002, at 20:26 US/Eastern, Jule Slootbeek wrote:


well, i got it to read a html file, but the problem is that it reads 
it after it loads it, so it doesn't read the tags, and i'm looking 
for the string in between title and /title
is there a way using fopen()  or something similar to read an 
html/php file before it's loaded?

Jule

On Friday, Nov 1, 2002, at 17:45 US/Eastern, Jule Slootbeek wrote:

i thought fopen() was only for local files, didn't even bother 
looking, but now i think about it..it makes perfect sence to open 
url's as well, thanks a lot!

Jule

On Friday, Nov 1, 2002, at 17:42 US/Eastern, John Nichel wrote:

Docs - Function Reference - Filesystem Functions - fopen()

It was hidden.

Jule Slootbeek wrote:

hey
is there a way to get the URL header? the title meta tags etc?
i couldn't find any function in the docs, but maybe i just don't 
know where to look.
if there's a function that pulls in an entire page that;s fine too 
i can work with that..
any help appreciated
TIA
Jule
Jule Slootbeek
[EMAIL PROTECTED]



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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



Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] Re: getting HTML header from URL [solved]

2002-11-01 Thread Jule Slootbeek
yeah i just noticed that myself too,
and unfortunatly people do code their html like that..

J
On Friday, Nov 1, 2002, at 21:44 US/Eastern, David U. wrote:


Jule Slootbeek wrote:

oops didn't catch two little bugs

Jule

function getTitle($url)
{
$file = @fopen($url, 'r');

if(!$file) {
$rline = Error, contact webmaster;
} else {
while (!feof ($file)) {
  $line = fgets($file);
  if (substr_count(strtoupper($line), TITLE) = 1) {
$rline = strip_tags($line);
//return $rline;
//fclose($file);
break;
}
 }
 return $rline;
 }
fclose($file);
}


1) What if this line looks like:
htmlheadtitlefoo/title/headbodybar/body/html
Wont' $rline == foobar ?

2) Can't you use a socket and read until the first TITLEstart saving 
until
the /TITLE and close the socket?

-davidu





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


Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] Best way to put layout, code on pages?

2002-10-10 Thread Jule Slootbeek

What i usually do, is make a file layout.php with a couple of 
functions, header() footer() etc.

then i include ('layout.php') and call the functions when i need them

and i can send things to the header, like the page title etc.

include ('layout.php');
header(Home);
blablablab
footer();

i hope this is about what you mean

Jule

On Thursday, Oct 10, 2002, at 23:00 US/Eastern, Leif K-Brooks wrote:

 I've been using php for a while now, and I've made plenty of web sites 
 in that time.  But there's been a nagging problem: the best way to put 
 a

 layout and global code on each page.  My first site had two .txt files 
 with header and footer code which were fopen()ed (with absolute 
 paths!) and eval()ed on each page at the top and bottom - not the best 
 option! Even if I include()d them and made them .php, that approach 
 would still

 have some problems.  No way to get the global code without the layout, 
 and no way to die() and use the layout in functions without knowing 
 what

 variables it needs (for globalizing them).  Right now, I'm doing 
 something like this:

?php
include(include.php); //This contains the database connection code
and whatever other global code, as well as the layout functions.
doheader(); //This function contains the top of the layout.
//Do whatever the page does
dofooter(); //This function contains the bottom of the layout
?

 There are still problems with this, though.  No way to use global code 
 at the bottom of the page, for one thing.  I've also considered 
 something like:

?php
$uselayout = true; //Set whether this page wants the layout or not.
include(include.php);
headercode(); //Database connection and whatever other global code
that goes at the top, as well as the layout if $uselayout is true.
//Whatever this page does goes here.
footercode(); //Whatever global code that goes at the bottom goes
here, as well as the layout if $uselayout is true.
?

 I can't find any problems with this approach, what are everyone;'s 
 thoughts on this?

 -- 
 The above message is encrypted with double rot13 encoding.  Any
 unauthorized attempt to decrypt it will be prosecuted to the full 
 extent
 of the law.


Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] register_global variables on Mac OS X

2002-10-08 Thread Jule Slootbeek

Hi,
i just installed PHP under Mac OS X and now i was looking around trying 
to find the php.ini file, or its equivalent, in order to turn 
register_globals to on, so i don't have to go through 15 pages of code 
and change all my variables to $_POST['foo'] but i couldn't find 
anywhere where this action could be done. So i was wondering if anybody 
had experience with PHP under Jaguar, and could lend me a hand.

TIA,

Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] register_global variables on Mac OS X

2002-10-08 Thread Jule Slootbeek

Yeah that's the path to where php.ini should be (/usr/local/lib, in my 
case, but the Jaguar version of PHP doesn't use a php.ini file, so 
there's nothing there.

Jule

On Tuesday, Oct 8, 2002, at 22:34 US/Eastern, Timothy J Hitchens wrote:

 Make a page with ?php phpinfo(); ? then display
 the page threw the server into the browser... and it should
 like the location in the top area.




 Timothy Hitchens (HITCHO)
 [EMAIL PROTECTED]

 HITCHO has Spoken!






 -Original Message-
 From: Jule Slootbeek [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, 9 October 2002 12:32 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] register_global variables on Mac OS X


 Hi,
 i just installed PHP under Mac OS X and now i was looking around trying
 to find the php.ini file, or its equivalent, in order to turn
 register_globals to on, so i don't have to go through 15 pages of code
 and change all my variables to $_POST['foo'] but i couldn't find
 anywhere where this action could be done. So i was wondering if anybody
 had experience with PHP under Jaguar, and could lend me a hand.

 TIA,

 Jule Slootbeek
 [EMAIL PROTECTED]


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


Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] register_global variables on Mac OS X

2002-10-08 Thread Jule Slootbeek

well, there is no such file, i searched all over my drive, and there is 
no php-ini.* php_ini.*
i guess i could try getting a php.ini file from somewhere and putting 
it in the /usr/local/lib dir
but i wouldn't know where to get a 'standard' php.ini file

Jule

On Tuesday, Oct 8, 2002, at 22:43 US/Eastern, John W. Holmes wrote:

 You may not have one right now and PHP is using it's defaults. Look for
 a php-ini.dist or php-ini.recommended in the php folder. Modify one of
 those and save it as php.ini. But, I have no idea where to save it on a
 Mac.

 Like the other poster said, load up a ? phpinfo(); ? page through 
 your
 browser and PHP may tell you where it thinks php.ini should be. It'll 
 be
 in the first block that appears on the page created by phpinfo().

 ---John Holmes...

 -Original Message-
 From: Jule Slootbeek [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, October 08, 2002 10:32 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] register_global variables on Mac OS X

 Hi,
 i just installed PHP under Mac OS X and now i was looking around
 trying
 to find the php.ini file, or its equivalent, in order to turn
 register_globals to on, so i don't have to go through 15 pages of code
 and change all my variables to $_POST['foo'] but i couldn't find
 anywhere where this action could be done. So i was wondering if
 anybody
 had experience with PHP under Jaguar, and could lend me a hand.

 TIA,

 Jule Slootbeek
 [EMAIL PROTECTED]


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


Jule Slootbeek
[EMAIL PROTECTED]


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




Re: [PHP] register_global variables on Mac OS X

2002-10-08 Thread Jule Slootbeek

i didn't install from source, i installed from an OS X binary i found 
in the php website, i got a php.ini from someone else which i
'm suing, thanks guys!

Jule

On Tuesday, Oct 8, 2002, at 23:54 US/Eastern, CC Zona wrote:

 In article [EMAIL PROTECTED],
  [EMAIL PROTECTED] (Jule Slootbeek) wrote:

 Yeah that's the path to where php.ini should be (/usr/local/lib, in my
 case, but the Jaguar version of PHP doesn't use a php.ini file, so
 there's nothing there.

 Jaguar uses php.ini if it's in the expected location.  That you don't 
 have
 one yet is a matter easily resolved.

 You can use an ASCII text editor (BBEdit Lite, for instance
 http://www.bbedit.com/products/bbedit_lite/lite-download.html) to 
 create
 a new document and fill it with your favorite options.

 Or do as others have recommended and download a prewritten one from 
 php.net
 and place it in the designated location (renamed to php.ini if 
 necessary).

 Or see the configuration page http://php.net/configuration for
 descriptions of other alternatives (ini_set(), .htaccess).

 -- 
 CC

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


Jule Slootbeek
[EMAIL PROTECTED]


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




[PHP] check if a foreach loop has successfully run

2002-06-25 Thread Jule Slootbeek

Hey list,
How do i check if my script has successfully run through an entire foreach() loop
do i just go

if (foreach ($answer as $a) { echo $a })
{
return TRUE;
} else {
return FALSE;
}

thanks in advance.

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] simplicity with 2 queries..

2002-06-09 Thread Jule Slootbeek

Hey guys and gals,

I have the following function which accesses the following tables, now i want to 
know if there is a way to get the quiz_id from table quiz without runnning both 
these queries...
thanks,

Jule

--tables--

mysql describe user;
++--+--+-+-++
| Field  | Type | Null | Key | Default | Extra  |
++--+--+-+-++
| user_id| int(10) unsigned |  | PRI | NULL| auto_increment |
| first_name | varchar(10)  |  | | ||
| last_name  | varchar(20)  |  | | ||
| email  | varchar(100) |  | | ||
| username   | varchar(16)  |  | | ||
| password   | varchar(32)  |  | | ||
++--+--+-+-++

mysql describe quiz;
+-+--+--+-+-++
| Field   | Type | Null | Key | Default | Extra  |
+-+--+--+-+-++
| quiz_id | int(10) unsigned |  | PRI | NULL| auto_increment |
| user_id | int(10) unsigned |  | | 0   ||
| title   | varchar(255) |  | | ||
| noa | tinyint(2)   |  | | 0   ||
+-+--+--+-+-++

--function--

function addquiz_get_quiz_id() {

global $valid_user, $valid_password;

mysql_select_db($db_glob, $link_glob);

$table_user = user;
$table_quiz = quiz;
$query = SELECT * FROM $table_user WHERE username='$valid_user' AND 
password='$valid_password';
$result = mysql_query($query);
$user_info = mysql_fetch_array($result);
$user_id = $user_info[user_id];

$query = SELECT * FROM $table_quiz WHERE user_id='$user_id';
$result = mysql_query($query);
$user_info = mysql_fetch_array($result);
$quiz_id = $user_info[quiz_id];

mysql_close($link_glob);
return $quiz_id;
}
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] return array

2002-06-06 Thread Jule Slootbeek

Hey guys and gals,

if i have a function
and i return an array from it

function my_function() {
blabla;
return array ($array['name'], $array['password']);
}

how do i get this into an array on the page i call the function?

$array = my_function() doesn't work?

any ideas?
thanks

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




Re: [PHP] return array

2002-06-06 Thread Jule Slootbeek


 
 try:
 
 list($doo, $dah) = my_function();
 

thanks alot
that was it

list ($array['name'], $array['password']);

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] User Authentication

2002-06-04 Thread Jule Slootbeek

Hey guys,

What is the best way for user authentication (now i'm talking about the
most secure and easiest way).
Now i've been using sessions, and i was wondering if cookies were better 
and easier...

any thoughts?
thanks,

Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED]

http://blindtheory.cjb.net




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




Re: [PHP] User Authentication

2002-06-04 Thread Jule Slootbeek

John Holmes wrote:
 Sessions use cookies as it is...so what do you really want to do...what
 do you want to protect?
 
 ---John Holmes...
 
 

Oh ok, that explains it then...
Well thanks for the info anyway. I was basically just wondering which 
method was reccommended..

Jule

-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] stupid error, please kick me (and send me a solution)

2002-06-03 Thread Jule Slootbeek

Hey guys,
i'm getting this error with the following sql script using php:
--error--
Warning: Supplied argument is not a valid MySQL-Link resource in 
/var/www/phpquiz/register_user.php on line 12
--error--

--script--
$link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob');
$query = INSERT INTO user values('0', '$fname', '$lname', '$email', 
'$username', PASSWORD('$password');
$result = mysql_db_query('$db_glob', '$query', $link_glob');
if (!$result) {
echo font size=+1Your Information could not be 
entered into the database, 
Please contact the a 
href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() . 
:  . mysql_error() . brbr;
} else {
echo font size=+1Your Information has successfully 
been entered into the 
database!/fontbr;

-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




Re: [PHP] Re: stupid error, please kick me (and send me a solution)

2002-06-03 Thread Jule Slootbeek

[EMAIL PROTECTED] wrote:
 Do not use double kotes here. 
 $link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\',
 \'$pw_glob\')\;
 
 mysql_connect is a function.
 
 Regards,
 
 Laercio Fortes
 
 
 
 
 Citando Jason Soza [EMAIL PROTECTED]:
 
 
If this is truly the code you\'re using, you\'re missing the closing 
curly-brace after the else statement. I.e. this:
} else {
  echo \font size=+1Your Information has successfully been 
entered into the database!/fontbr\;

Should be this:
} else {
  echo \font size=+1Your Information has successfully been 
entered into the database!/fontbr\;
   }

HTH,
Jason Soza

- Original Message -
From: Jule Slootbeek [EMAIL PROTECTED]
Date: Monday, June 3, 2002 2:09 pm
Subject: stupid error, please kick me (and send me a solution)


Hey guys,
i\'m getting this error with the following sql script using php:
--error--
Warning: Supplied argument is not a valid MySQL-Link resource in 
/var/www/phpquiz/register_user.php on line 12
--error--

--script--
$link_glob = \mysql_connect(\'$host_glob\', \'$un_glob\', \'$pw_glob\')\;
$query = \INSERT INTO user values(\'0\', \'$fname\', \'$lname\', 
\'$email\', 
\'$username\', PASSWORD(\'$password\')\;
 $result = mysql_db_query(\'$db_glob\', \'$query\', 
$link_glob\');   if (!$result) {
 echo \font size=+1Your Information 
could not be entered into the database, 
Please contact the 
href=mailto:$webmasterwebmaster./fontbrbr\ . mysql_errno() 
. 
\: \ . mysql_error() . \brbr\;
 } else {
 echo \font size=+1Your Information 

has 

successfully been entered into the 
database!/fontbr\;

-- 
Jule Slootbeek   
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 


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



 
 
 

changing that line to this:
$link_glob = mysql_connect($host_glob, $un_glob, $pw_glob);
doesn't make any difference...
i still get the error..
could it be my setup?
the $link_glob var is in globals.inc.php and i use this through 
require('globals.inc.php'); which has worked great in the past...
the other two lines.
Now:
$query = INSERT INTO user values('0', '$fname', '$lname', '$email',
'$username', PASSWORD('$password');
$result = mysql_db_query($db_glob, $query, $link_gob);
are in register_user.php in which the first line is 
require('globals.inc.php');

I've used this method in the past also, and i've never experienced 
problems with it...
  thanks,
Jule
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] Re: stupid error, please kick me (and send me a solution)

2002-06-03 Thread Jule Slootbeek

G r e g L a w r i e wrote:
 It would also appear you are missing a closing ) at the end of the
 '$query=...' line. You have two opening backets and only one closing.
 
 Greg
 
 -Original Message-
 From: Bruce Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, 4 June 2002 7:50
 To: [EMAIL PROTECTED]; mysql; php-general
 Subject: Re: stupid error, please kick me (and send me a solution)
 
 
 Your missing your closing } at the end of the else statement.
 
 
 - Original Message -
 From: Jule Slootbeek [EMAIL PROTECTED]
 To: mysql [EMAIL PROTECTED]; php-general
 [EMAIL PROTECTED]
 Sent: Monday, June 03, 2002 5:09 PM
 Subject: stupid error, please kick me (and send me a solution)
 
 
 
Hey guys,
i'm getting this error with the following sql script using php:
--error--
Warning: Supplied argument is not a valid MySQL-Link resource in
/var/www/phpquiz/register_user.php on line 12
--error--

--script--
$link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob');
$query = INSERT INTO user values('0', '$fname', '$lname', '$email',
'$username', PASSWORD('$password');
$result = mysql_db_query('$db_glob', '$query', $link_glob');
if (!$result) {
echo font size=+1Your Information could not be entered into the
 
 database,
 
Please contact the a
href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() .
:  . mysql_error() . brbr;
} else {
echo font size=+1Your Information has successfully been entered into
 
 the
 
database!/fontbr;

--
Jule Slootbeek
[EMAIL PROTECTED]

http://blindtheory.cjb.net



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
 
 [EMAIL PROTECTED]
 
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


 
 
 
 
 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)
 
 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
 

$query = INSERT INTO user values('0', '$fname', '$lname', '$email', 
'$username', PASSWORD('$password');

that should be all closed shouldn't it?
my text editor colors code, and it doesn't show any mistakes..
thanks though
Jule

-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] Re: stupid error, please kick me (and send me a solution)

2002-06-03 Thread Jule Slootbeek

Jule Slootbeek wrote:
 G r e g L a w r i e wrote:
 
 It would also appear you are missing a closing ) at the end of the
 '$query=...' line. You have two opening backets and only one closing.

 Greg

 -Original Message-
 From: Bruce Lewis [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, 4 June 2002 7:50
 To: [EMAIL PROTECTED]; mysql; php-general
 Subject: Re: stupid error, please kick me (and send me a solution)


 Your missing your closing } at the end of the else statement.


 - Original Message -
 From: Jule Slootbeek [EMAIL PROTECTED]
 To: mysql [EMAIL PROTECTED]; php-general
 [EMAIL PROTECTED]
 Sent: Monday, June 03, 2002 5:09 PM
 Subject: stupid error, please kick me (and send me a solution)



 Hey guys,
 i'm getting this error with the following sql script using php:
 --error--
 Warning: Supplied argument is not a valid MySQL-Link resource in
 /var/www/phpquiz/register_user.php on line 12
 --error--

 --script--
 $link_glob = mysql_connect('$host_glob', '$un_glob', '$pw_glob');
 $query = INSERT INTO user values('0', '$fname', '$lname', '$email',
 '$username', PASSWORD('$password');
 $result = mysql_db_query('$db_glob', '$query', $link_glob');
 if (!$result) {
 echo font size=+1Your Information could not be entered into the


 database,

 Please contact the a
 href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() .
 :  . mysql_error() . brbr;
 } else {
 echo font size=+1Your Information has successfully been entered into


 the

 database!/fontbr;

 -- 
 Jule Slootbeek
 [EMAIL PROTECTED]

 http://blindtheory.cjb.net



 -
 Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail


 [EMAIL PROTECTED]

 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php






 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

 
 $query = INSERT INTO user values('0', '$fname', '$lname', '$email', 
 '$username', PASSWORD('$password');
 
 that should be all closed shouldn't it?
 my text editor colors code, and it doesn't show any mistakes..
 thanks though
 Jule
 
well it didn't fix it, but still thanks,

Jule



-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




[PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (and send mea solution))

2002-06-03 Thread Jule Slootbeek

ok, i think i fixed up everything everybody told me (although some
answers did contradict) and here is the entire script...

Jule

--script (globals.inc.php)--
?php
$host_glob = localhost;
$db_glob = phpquiz;
$un_glob = phpquiz;
$pw_glob = phpquiz;

$link_glob = mysql_connect($host_glob, $un_glob, $pw_glob);

$webmaster = [EMAIL PROTECTED];
?
--script (globals.inc.php)--

--script (register_user.php)--
?php
session_start();

require(globals.inc.php);
require(layout.fnct.php);

html_header(Register a New User, Enter Information);
/**/
if ($fname  $lname  $email  $username  $password  $vpassword) {
if ($password != $vpassword) {
echo font size = +1 color = \#FF\Your passwords do 
not match,
please try again/fontbr;
 } else {
if (!$link_glob) {
echo font size=+1 color=\#FF\You could not 
connect to the
database.brPlease contact the a
href=mailto:$webmasterwebmaster/a.brbr/font . mysql_errno() .
:  . mysql_error() . br;
} else {
if (!mysql_select_db($db_glob, $link_glob)) {
echo font size=+1 color=\#FF\The 
Database could not be selectedbr
Please contact the a
href=mailto:$webmasterwebmaster/a.brbr/font . mysql_errno() .
:  . mysql_error() . br;
} else {
$table_user = user;
$query = INSERT INTO $table_user values('0', 
'$fname', '$lname', '$email',
'$username', PASSWORD('$password'));
$result = mysql_query('$query', '$link_glob');
if (!$result) {
echo font size=+1 
color=\#FF\Your Information could not be entered
into the database.br Please contact the a
href=mailto:$webmasterwebmaster/a./fontbrbr . mysql_errno() .
:  . mysql_error() . br;
} else {
echo font size = +1 
color=\#FF\Your Information has successfully been
entered into the database!/fontbr;
echo click a 
href=\manage_account.php\here/a to change your personal
options and to add your first quiz!;
html_footer();
exit;
}
}
}
}
}
echo font size=+1Please enter the required information/font;
echo   form method=post action=register_user.php
Name:   input type=text name=fname size=10 maxlength=10
input type=text name=lname size=20 maxlength=20br
Email:  input type=text name=email size=30 maxlength=100br
UserName: input type=text name=username size=16 
maclength=16br
Password: input type=password name=password size=8 
maxlength=8br
Verify Password: input type=password name=vpassword size=8 
maxlength=8brbr
input type=submit value=\Register\input type=reset 
value=\Clear\
/form;
/**/
html_footer();
?

--script (register_user.php)--
-- 
Jule Slootbeek  
[EMAIL PROTECTED]

http://blindtheory.cjb.net



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




[PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (and sendme a solution))

2002-06-03 Thread Jule Slootbeek

ps: it was still not working..
-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




Re: [PHP] HUGE ERROR (was: [PHP] stupid error, please kick me (andsend me a solution))

2002-06-03 Thread Jule Slootbeek

Philip Olson wrote:
 Please post:
 
   a) the error
   b) if the error is line #5, just post related lines line 4-6.
 
 I did see this:
 
   $result = mysql_query('$query', '$link_glob');
 
 Which should be:
 
   $result = mysql_query($query, $link_glob);
 
 
 
 
OK that did fix the problem...:)
I am now going to sit in a corner and be ashamed of myself

thanks Philip and and everybody else...

Jule

-- 
Jule Slootbeek  
[EMAIL PROTECTED] 

http://blindtheory.cjb.net 



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




Re: [PHP] Time release type question

2002-05-28 Thread Jule

I think that is right Jay, 
you can use mktime() to change the date into unix time and then create the if 
statement

if ((mktime([current])) == (mktime([date of assignment])) {
echo link to assignment
}

something along those lines..
you can easily check it by setting the system clock forward

Jule

On Wednesday 29 May 2002 00:14, you wrote:
 On Wednesday 29 May 2002 11:52, Dr. Indera wrote:
  I am in the planning stage of building an online course room. Each week I
  need to upload pages for that weeks lesson and assignments. What I want
  to know is if there is a way for me to have all 8 weeks of the course
  pages created and upload them all at one time, but only have certain
  pages 'visible' based on the current date.
 
  This is an example of what I'm talking about.
 
  Week 1  pages would be visible starting June 3rd
  Week 2  pages would be visible starting June 10th
  Week 3 pages would be visible starting June 17th

 Am I missing something? It's just a simple matter of checking the current
 date and if it exceeds defined threshold (say June 3rd) then display the
 page otherwise display an error message or redirect or whatever.

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Login determines content on page

2002-05-28 Thread Jule

That's all possible using an SQL database (www.mysql.com)
just think about the databnse first before you actually make it, i ran into a 
lot of problems because i just kept adding tables whenever i needed them
a good hint is to write scemes of your script and what ylu want to achieve on 
paper before actually starting coding..

see www.php.net and www.mysql.com for all the docs you need. They really 
helped me along, so did the this list.

Jule

On Wednesday 29 May 2002 00:24, Dr. Indera wrote:
 Hello,

 I'd to know how difficult it is to achieve the following:

 Create login page, when the submit button is clicked, the user info is
 checked against a database as

 to whether is login info is valid. if it is valid, a page is displayed that
 lists all of the classes

 that the user has registered for, meaning each user will see a different
 list of classes.

 Thanks
 Indera

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Time release type question

2002-05-28 Thread Jule


 actually that should be

for ($n = 1; $n = $number_of_assignments; $n++) {
if (mktime($current) = mktime($assignment[$n]) {
echo assignment[$n]br\n;
}
}

Jule

On Wednesday 29 May 2002 00:31, Jule wrote:
 I think that is right Jay,
 you can use mktime() to change the date into unix time and then create the
 if statement

 if ((mktime([current])) == (mktime([date of assignment])) {
   echo link to assignment
 }

 something along those lines..
 you can easily check it by setting the system clock forward

 Jule

 On Wednesday 29 May 2002 00:14, you wrote:
  On Wednesday 29 May 2002 11:52, Dr. Indera wrote:
   I am in the planning stage of building an online course room. Each week
   I need to upload pages for that weeks lesson and assignments. What I
   want to know is if there is a way for me to have all 8 weeks of the
   course pages created and upload them all at one time, but only have
   certain pages 'visible' based on the current date.
  
   This is an example of what I'm talking about.
  
   Week 1  pages would be visible starting June 3rd
   Week 2  pages would be visible starting June 10th
   Week 3 pages would be visible starting June 17th
 
  Am I missing something? It's just a simple matter of checking the current
  date and if it exceeds defined threshold (say June 3rd) then display the
  page otherwise display an error message or redirect or whatever.

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Is this a bug?

2002-05-27 Thread Jule

Dunno if it's a bug, but it's 2147483648 to max for an integer? doesn't 
bigint support higher numbers than that?
i'm not sure but i think that's why your number gor cut down.

Jule 
On Monday 27 May 2002 22:36, zhaoxd wrote:
 Hello all:
 
 Not long ago I wrote some php code in my computer which had a apache
 server,and my php version is 4.0.5.The code as followed:
 
 $num = 2886732778;
 settype($num, integer);
 echo $num;
 
 And I found the num is -2147483648.attention,please:the version of
 php is 4.0.5.
 
 When I installed php-4.2.0 in my computer,however,I found the output
 of result is -1408234499.
 
 Why did the difference between the two version php happen?Is this a
 bug???
 
 Any help is appreciated!
 zhaoxd
 
 

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Is this a bug?

2002-05-27 Thread Jule

ps: sorry for all the typos...

Jule
On Monday 27 May 2002 22:51, Jule wrote:
 Dunno if it's a bug, but it's 2147483648 to max for an integer? doesn't
 bigint support higher numbers than that?
 i'm not sure but i think that's why your number gor cut down.

 Jule

 On Monday 27 May 2002 22:36, zhaoxd wrote:
  Hello all:
 
 
 
  Not long ago I wrote some php code in my computer which had a apache
 
  server,and my php version is 4.0.5.The code as followed:
 
 
 
  $num = 2886732778;
 
  settype($num, integer);
 
  echo $num;
 
 
 
  And I found the num is -2147483648.attention,please:the version of
 
  php is 4.0.5.
 
 
 
  When I installed php-4.2.0 in my computer,however,I found the output
 
  of result is -1408234499.
 
 
 
  Why did the difference between the two version php happen?Is this a
 
  bug???
 
 
 
  Any help is appreciated!
 
  zhaoxd

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Is this a bug?

2002-05-27 Thread Jule

see this page:

http://www.php.net/manual/en/language.types.integer.php

Jule

On Monday 27 May 2002 22:52, Jule wrote:
 ps: sorry for all the typos...

 Jule

 On Monday 27 May 2002 22:51, Jule wrote:
  Dunno if it's a bug, but it's 2147483648 to max for an integer? doesn't
  bigint support higher numbers than that?
  i'm not sure but i think that's why your number gor cut down.
 
  Jule
 
  On Monday 27 May 2002 22:36, zhaoxd wrote:
   Hello all:
  
  
  
   Not long ago I wrote some php code in my computer which had a
   apache
  
   server,and my php version is 4.0.5.The code as followed:
  
  
  
   $num = 2886732778;
  
   settype($num, integer);
  
   echo $num;
  
  
  
   And I found the num is -2147483648.attention,please:the version of
  
   php is 4.0.5.
  
  
  
   When I installed php-4.2.0 in my computer,however,I found the
   output
  
   of result is -1408234499.
  
  
  
   Why did the difference between the two version php happen?Is this a
  
   bug???
  
  
  
   Any help is appreciated!
  
   zhaoxd

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] job payment.

2002-05-19 Thread Jule

Hey guys,
I got an offer to do some php/mysql design for a local company,
basically what it's going to be is to take the current Access DB and make it
acessible through a webpage (that's the basic info they gave me).
How much should i except to get paid for this, and what is an acceptable
amount, for the completion of this project, or per hour?

Jule
--

|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

---

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] Re: job payment.

2002-05-19 Thread Jule

Hey everybody,

thanks a lot for all the info i got, i know it's kindof a stragne question, 
but i really had no idea to expect what to earn or to be offered in a 
situation like the one i'm in now.
Now i know what to compare with and how to deal with everything and i think 
i'm set on job-instructions for the rest of my life.

thanks a lot
i really appreciate it.

Jule

On Sunday 19 May 2002 20:46, Doug Riddle wrote:
 --- Jule [EMAIL PROTECTED] wrote:
  Hey guys,
  I got an offer to do some php/mysql design for a local company,
  basically what it's going to be is to take the current Access DB and make
  it acessible through a webpage (that's the basic info they gave me). How
  much should i except to get paid for this, and what is an acceptable
  amount, for the completion of this project, or per hour?
 
  Jule
  --

 Jule:

  I cannot guess what the going rate in New England is for DB
 programming. A few years ago I was getting $20.00 US for work like it.  I
 have made a lot more too, it sort of depends on what the market will bear. 
 I suspect they are not sure themselves.  I can offer a few things to think
 about...

 Things to consider:
 1) Task Creep/Function creep/add-in bloat/design creep/ etc.
  Get it clear up front what it is they expect and what constitutes a
 completed project.  If there is not a clear design and task list, then even
 they are not sure what they want.  They want someone to figure that out for
 them, and are probably not fully aware of the effort involved, or the cost.
  In that case I would ask for hourly wages.  That way, changes to the
 project in mid-stream do not require negotiations about cost and pay.

 2) Deliverables.  Make sure you get a schedule of when they want what.  You
 will need time to figure out the DB, and work with them on the front-end
 the client will see, not to mention the nuts and bolts of the job.  Break
 the project into bite-sized pieces and get their buy-in on each stage.  Get
 the guidlines in writing and a firm definition of what they consider a
 completed project in the contract.

 3) Coordination.  If at all possible, get one, or at the most two, people
 to act as coordinators.  These should be people able to approve designs,
 make decisions and preferably write checks.  Avoid designing by committee
 wherever possible.

 4) Contract.  Get it in writing.  Unless they are offering you a position
 with their company, they will expect a contract.  It doesn't have to be a
 complicated  formal affair.  Just discuss the job, write down their
 expectations and convert that into a for the completion of this project as
 outlined herein, the company of I've-got-your-wallet agrees to pay my
 company, and-all-your-money, X dollars per hour for the building of this
 web site.  The company agrees to provide ample opportunity to discuss the
 deliverables as outlined and tender approval in a timely basis, etc. 
 That's it, save your receipts and keep good notes.  That will allow you to
 be sure you own any code you write, not them.  They are buying the use of
 the code, not the code.  Make sure you work that in somewhere.

 After that, just enjoy yourself.

 =
 Warmest Regards,
 Doug Riddle
 http://www.dougriddle.com

 ## If they do discover life on other planets, who will get to them first,
 The Democrats, the Republicans, Avon, or the Latter Day Saints?  ##


 __
 Do You Yahoo!?
 LAUNCH - Your Yahoo! Music Experience
 http://launch.yahoo.com

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] random order by id

2002-05-18 Thread Jule


Hey guys,
i have a db and a table with id and questions
now i want these questions to be listed in a random order, is there a way
to format my SQL query or do i need some PHP work to?
i can ofcourse select a random one, that's no problem, but how do i make
sure that that one does not get chosen again. and that after it has printed
all the records it stops
any ideas?

Jule

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] $answers[answer$n]

2002-05-17 Thread Jule

Hey guys,
i'm getting this error whe i try to access this variable. $answers[answer$n]

Parse error: parse error, expecting `']'' in 
/home/blindtheory/web/quiz/add_quiz/add_quiz_process_2.php on line 36

the variable $answer[answers$n] comes from a form on the preceding page in 
which a number of answers has been entered. the number of answers is up to 
the user and can vary from 2 to 15. not the $n comes from a for loop whcih 
enteres the answers into a database since i do not know how many answers each 
user has used.

why am i getting this error?
and is there a way around it?
following is the for() loop in which this story takes place.

thanks
Jule

--SCRIPT--

for ($n = 1; $n = $quiz[number_answers]; $n++) {
$table = $quiz[code]_answers;
$value = $answers[answer$n];
$query_alter_table = ALTER table $table ADD answer$n TEXT NUT 
NULL;
$query_add_answers = INSERT INTO $table (answer$n) 
VALUES($value);
if (mysql_db_query($database_glob, $query_alter_table, 
$link_glob) AND 
(mysql_db_query($database_glob, $query_add_answer, $link_glob));
echo Answer $n has successfully been added to the 
Quizbr\n;
} else { 
echo mysql_error();
}
echo Click here to continue;
}

--SCRIPT--

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] Alter table and add cell at a time.

2002-05-17 Thread Jule

a question:

if i have this:

for ($n = 1; $n = $quiz[number_answers]; $n++) {
$table = $qcode._answers;
$value = $answers[answer.$n];
$value2 = answer.$n;

$query_alter_table = ALTER TABLE $table ADD $value2 TEXT NOT NULL;
$query_add_answers = INSERT INTO $table ($value2) VALUES('$value');
if (mysql_db_query($database_glob, $query_alter_table, $link_glob)) {
if (mysql_db_query($database_glob, $query_add_answers, $link_glob)) {
echo Answer $n: $value has successfully been added to the 
Quizbr\n;
} else {
echo mysql_error() . 1br;
}
} else {
echo mysql_error(). 2br;
}
}

How do I get the $value to be in the same row as the preceding one?
now it comes like this:
++-+-+-+-+

| id | answer1 | answer2 | answer3 | answer4 |

++-+-+-+-+

|  1 | answer1 | | | |
|  2 | | answer2 | | |
|  3 | | | answer3 | |
|  4 | | | | answer4 |

++-+-+-+-+

so it's like this?
++-+-+-+-+

| id | answer1 | answer2 | answer3 | answer4 |

++-+-+-+-+

|  1 | answer1 | answer2 | answer3 | answer4 |

++-+-+-+-+

thanks,

Jule

On Friday 17 May 2002 19:17, you wrote:
 Hello,

 Try using NOT NULL.  As weird as MySQL can be, don't think it is that
 NUTty.  =)

 Harrison

 - Original Message -
 From: Jule [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, May 17, 2002 7:00 PM
 Subject: ALTER TABLE $table ADD $value2 TEXT NUT NULL


 Hey i'm getting this error:

 You have an error in your SQL syntax near 'NUT NULL' at line 1

 when i run this query,

 ALTER TABLE $table ADD $value2 TEXT NUT NULL

 from the documentation i understood that this was the correct notation.

 any ideas?
 thanks
 Jule
 --

 |\/\__/\/|
 |   Jule Slootbeek |
 |   [EMAIL PROTECTED] |
 |   http://blindtheory.cjb.net |
 |   __ |
 |/\/   \/\|

 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php





 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED] Trouble
 unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

--

|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

---

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Feelin' dumb...

2002-05-17 Thread Jule

try,

for ($i=1; $i=$num_pages; $i = $i + 20) {
}


or try,

$i = 1;
while ($i=$num_pages) {
//text here
$i = $i + 20;
}

I got those little problems too all the time..
and the boards/lists always help.
Jule

On Friday 17 May 2002 23:19, you wrote:
 Okay, I'm apologizing right now for this, but I hope it's at least
 tolerable. I have this:

 for ($i=1; $i=$num_pages; $i++) {
   // print stuff here
   }

 For each loop, I want to add 20 to $i, so after the first iteration, I have
 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking in the
 manual, but I assume this is some C-type function, and I'm not familiar
 with C!

 Any helpers?

 Jason Soza

--

|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

---

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] Feelin' dumb...

2002-05-17 Thread Jule

would that work?

isn't $i++; abbr. for $i = $i + 1;

so now the $i + 20; doens't declare anything.

just like $i += $b; is abbr. $i = $i + $b;

Jule.


On Friday 17 May 2002 23:14, you wrote:
 Hmm... Wouldn¹t you just do this?:

 for ($i=1; $i=$num_pages; $i+20) {
   // print stuff here
 }

 Rick

 The vision must be followed by the venture. It is not enough to stare up
 the steps - we must step up the stairs. - Vance Havner

  From: Jason Soza [EMAIL PROTECTED]
  Date: Fri, 17 May 2002 19:19:28 -0800
  To: [EMAIL PROTECTED]
  Subject: [PHP] Feelin' dumb...
 
  Okay, I'm apologizing right now for this, but I hope it's at least
  tolerable. I have this:
 
  for ($i=1; $i=$num_pages; $i++) {
  // print stuff here
  }
 
  For each loop, I want to add 20 to $i, so after the first iteration, I
  have 21, then 41, 61, etc. I've tried $i+20, $i + 20, I've tried looking
  in the manual, but I assume this is some C-type function, and I'm not
  familiar with C!
 
  Any helpers?
 
  Jason Soza
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] method=post problem

2002-05-15 Thread Jule

Hey guys and gals,

i have a form with method=post which sends 

input type=hidden name=quiz[quiz_title] value=$quiz[quiz_title]
input type=hidden name=quiz[owner_name] value=$quiz[owner_name]
input type=hidden name=quiz[owner_email] value=$quiz[owner_email]
input type=hidden name=quiz[number_answers] value=$quiz[number_answers]
input type=hidden name=submitted value=TRUE

to the same page, and  picks it up in an 
if ($submitted) {} loop.

but now here's the problem: 
when it comes back and goes into the loop. Only the first name from 
$quiz[owner_name] is left, so where it used to be John Doe, is now only Joe.
how do i fix this?

thanks

Jule
-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] random order

2002-05-12 Thread Jule

Hey guys and gals,
I have a problem: 
I have a mysql databse with 4 rows, and each row (row1, row2, row3, and row4) 
contains a sentence. now i want these sentences to appear in random order:
instance: 1 2etc.
 row2  row4
 row4  row2
 row1  row1
 row3  row3

how do i go about that??
any ideas apreciated.
thanks

Jule
-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




Re: [PHP] random order

2002-05-12 Thread Jule

hmm it got a little more complicated now,
i have a table with: id title question answer1 answer2 answer3 answer4.
how can i use all of those in a php page but only randomize the answers?

so i get

title   title

questionquestion

answer3 answer4
answer2 answer1
answer4 answer3
answer1 answer2

any ideas?
thanks,

Jule
On Sunday 12 May 2002 17:30, you wrote:
 Add on a LIMIT to restrict it to return a certain number of rows.

 If you had a table of say, 100 rows, and you wanted four random ones out
 of the 100, then you'd use this:

 SELECT * FROM table ORDER BY RAND() LIMIT 4;

 ---John Holmes...

  -Original Message-
  From: Jule [mailto:[EMAIL PROTECTED]]
  Sent: Sunday, May 12, 2002 11:22 AM
  To: [EMAIL PROTECTED]
  Subject: Re: [PHP] random order
 
  Thanks John,
  I thought that that command only selected a random row..
  must've read wrong.
  thanks.
 
  Jule
 
  On Sunday 12 May 2002 17:21, you wrote:
   Nothing to do with PHP...
  
   SELECT * FROM table ORDER BY RAND();
  
   ---John Holmes...
  
-Original Message-
From: Jule [mailto:[EMAIL PROTECTED]]
Sent: Sunday, May 12, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: [PHP] random order
   
Hey guys and gals,
I have a problem:
I have a mysql databse with 4 rows, and each row (row1, row2,

 row3,

   and
  
row4)
contains a sentence. now i want these sentences to appear in

 random

   order:
instance: 1 2etc.
 row2  row4
 row4  row2
 row1  row1
 row3  row3
   
how do i go about that??
any ideas apreciated.
thanks
   
Jule
--
   
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
 
  --
 
  |\/\__/\/|
  |   Jule Slootbeek   |
  |   [EMAIL PROTECTED]|
  |   http://blindtheory.cjb.net   |
  |   __   |
  |/\/  \/\|

-- 
|\/\__/\/|
|   Jule Slootbeek   |
|   [EMAIL PROTECTED]|
|   http://blindtheory.cjb.net   |
|   __   |
|/\/  \/\|

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




[PHP] global variables

2002-05-04 Thread Jule

Hey,
i'm just wondering if there is another way to write global variables to a 
global.php, now i just the whole fopen etc script, where i open a file and 
write the sctring $number_right = [whatever number it is] to the file, but is 
there a different way to write it to the file with one simple command?

i could use cookies, but i prefer a simpler way.

thanks

Jule
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] variables over 2 pages w/ a table.

2002-05-01 Thread Jule

Hey,

i've got a little problem:

I have two php pages

index.php and news/index.php

now in index.php there is a table which shows news/index.php

$left = news;
$ltitle = index;
$lext= php;

include ($left/$ltitle.$lext);

now this allows me to keep the layout the same, but change the pages within 
the table using URL commands 

index.php?left=newsltitle=indexlext=php

now news/index.php takes a variable: $start

if (empty($start)) $start= 0;
$end = $start+8;

$Query = SELECT * from $TableName ORDER BY postdate DESC LIMIT $start, $end;

this is to show eight(8) news articles at a time.
now also on the news/index.php page there is a link next to show the next 8 
articles.

a href=index.php?lext=php?start=8next/a

so this should link to the index page, which calls upon news/index.php, opens 
it in the left column of the table, and gives $start the value of 8.

but it gives me this error:

Warning: Failed opening 'news/index.php?start=8' for inclusion 
(include_path='') in /home/blindtheory/web/newweb/index.php on line 31

so how can i solve this and get the articles to show in groups of 8?

thanks in advance.

Jule  
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] parse error

2002-04-30 Thread Jule

Hey guys, i'm writing this guestbook script for my site, and i'm getting a 
random parse error where i think everything is normal, it gives it on line 26 
which is

echo Your entry will be posted!;

my script follows

Jule

--SCRIPT--

?php
$Guestbook[dateadd] = date(F j, Y H:i:s);
$Guestbook[name] = trim($Guestbook[name]);
$Guestbook[town] = trim($Guestbook[town]);
$Guestbook[email] = trim($Guestbook[email]);
$Guestbook[website] = trim($Guestbook[website]);
$Guestbook[favsong] = trim($Guestbook[favsong]);
$Guestbook[comments] = trim($Guestbook[comments]);
$Guestbook[mailinglist] = trim($Guestbook[mailinglist]);

$Host = localhost;
$User = ;
$Password = *;
$DBName = blindtheory;
$TableName = guestbook;
$TableName2 = mailinglist;
$Pattern = .+@.+..+;
$Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);

$Link = mysql_connect ($Host, $User, $Password);
$Query = INSERT into $TableName values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]', 
'$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
$Link2 = mysql_connect ($Host, $User, $Password);
$Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[email]');

if (mysql_db_query ($DBName, $Query, $Link)) {
echo Your entry will be added;
} else {
echo There was an error in during the posting, please contact 
a 
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
problem.br;
}

if (isset($Guestbook[mailinglist])) {

if (mysql_db_query ($DBName, $Query2, $Link2)) {
echo Your e-mail address was sucessfully added to our 
mailinglist;
} else {
echo There was an error in during the posting, please 
contact a 
href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the 
problem.br;
}
}
mysql_close ($Link);
mysql_close ($Link2);
?
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] parse error

2002-04-30 Thread Jule

Thanks for that, yeah i should be more carefull before going to the list..
i'll watch out for it next time.

Jule

On Tuesday 30 April 2002 13:54, Miguel Cruz wrote:
 You're missing a closing quote on the assignment for $Query2.

 Come on people, keep your eyes open. This is basic stuff. Doesn't take
 any special genius to count quotes and braces.

 miguel

 On Tue, 30 Apr 2002, Jule wrote:
  Hey guys, i'm writing this guestbook script for my site, and i'm getting
  a random parse error where i think everything is normal, it gives it on
  line 26 which is
 
  echo Your entry will be posted!;
 
  my script follows
 
  Jule
 
  --SCRIPT--
 
  ?php
  $Guestbook[dateadd] = date(F j, Y H:i:s);
  $Guestbook[name] = trim($Guestbook[name]);
  $Guestbook[town] = trim($Guestbook[town]);
  $Guestbook[email] = trim($Guestbook[email]);
  $Guestbook[website] = trim($Guestbook[website]);
  $Guestbook[favsong] = trim($Guestbook[favsong]);
  $Guestbook[comments] = trim($Guestbook[comments]);
  $Guestbook[mailinglist] = trim($Guestbook[mailinglist]);
 
  $Host = localhost;
  $User = ;
  $Password = *;
  $DBName = blindtheory;
  $TableName = guestbook;
  $TableName2 = mailinglist;
  $Pattern = .+@.+..+;
  $Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);
 
  $Link = mysql_connect ($Host, $User, $Password);
  $Query = INSERT into $TableName values('0', '$Guestbook[dateadd]',
  '$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]',
  '$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
  $Link2 = mysql_connect ($Host, $User, $Password);
  $Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]',
  '$Guestbook[name]', '$Guestbook[email]');
 
  if (mysql_db_query ($DBName, $Query, $Link)) {
  echo Your entry will be added;
  } else {
  echo There was an error in during the posting, please contact 
a
  href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
  problem.br;
  }
 
  if (isset($Guestbook[mailinglist])) {
 
  if (mysql_db_query ($DBName, $Query2, $Link2)) {
  echo Your e-mail address was sucessfully added to our 
mailinglist;
  } else {
  echo There was an error in during the posting, please 
contact a
  href=\mailto:[EMAIL PROTECTED]\;me/a and I will fix the
  problem.br;
  }
  }
  mysql_close ($Link);
  mysql_close ($Link2);
  ?

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] sending data to two tables.

2002-04-30 Thread Jule

Hey,
This time it's not about missing quotes or parenthasies i hope.
I'm trying to make a form which sends name, email, website, favsong and 
comments to table guestbook, but when the checkbox mailinglist is checked it 
should send the name and email to table mailinglist, but it doesn;t seem to 
work.
any pointers?

Jule

--SCRIPT--

?php
$Guestbook[dateadd] = date(F j, Y);
$Guestbook[name] = trim($Guestbook[name]);
$Guestbook[town] = trim($Guestbook[town]);
$Guestbook[email] = trim($Guestbook[email]);
$Guestbook[website] = trim($Guestbook[website]);
$Guestbook[favsong] = trim($Guestbook[favsong]);
$Guestbook[comments] = trim($Guestbook[comments]);
$Guestbook[mailinglist] = trim($Guestbook[mailinglist]);

$Host = localhost;
$User = ;
$Password = *;
$DBName = blindtheory;
$TableName = guestbook;
$TableName2 = mailinglist;
$Pattern = .+@.+..+;
$Pattern2 = (http://)?([^[:space:]]+)([[:alnum:]\.,-_?/=]);

$Link = mysql_connect ($Host, $User, $Password);
$Query = INSERT into $TableName values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[town]', '$Guestbook[email]', 
'$Guestbook[website]','$Guestbook[favsong]', '$Guestbook[comments]');
$Query2 = INSERT into $TableName2 values('0', '$Guestbook[dateadd]', 
'$Guestbook[name]', '$Guestbook[email]');

if (mysql_db_query ($DBName, $Query, $Link)) {
echo Your entry will be addedbrClick a 
href=../index.php?left=guestbookrighttop=guestbookrightbottom=guestbookrttitle=mailinglistrbtitle=gbaddhere/a
 
to go back.;
} else {
echo There was an error in during the posting, please contact 
a 
href=\mailto:[EMAIL PROTECTED]\;the webmaster/a and he will 
fix the problem.br;
}

mysql_close ($Link);

if (isset($Guestbook[mailinglist])) {

if (mysql_db_query ($DBName, $Query2, $Link)) {
echo Your e-mail address was sucessfully added to our 
mailinglist;
} else {
echo Your e-mail address will not be added to the 
mailinglist;
}
}

mysql_close ($Link);

?
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] sending data to two tables.

2002-04-30 Thread Jule

I don't know, every time i submit the form w/ the checkbox checked. it gives 
me the echo string which comes when the if is not executed..it adds the 
entries from the form to the guestbook table, but doesn't add the name and 
email to the mailinglist table. it doesn't give me any php or mysql errors.

Jule

On Tuesday 30 April 2002 23:35, you wrote:
 On Wednesday 01 May 2002 07:34, Jule wrote:
  Hey,
  This time it's not about missing quotes or parenthasies i hope.
  I'm trying to make a form which sends name, email, website, favsong and
  comments to table guestbook, but when the checkbox mailinglist is checked
  it should send the name and email to table mailinglist, but it doesn;t
  seem to work.

 We're not physic! How doesn't it work?

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] sending data to two tables.

2002-04-30 Thread Jule

So it executed the first if:

if (mysql_db_query ($DBName, $Query, $Link)) {
         echo Your entry will be addedbrClick 
a 
href=../index.php?left=guestbookrighttop=guestbookrightbottom=guestbookrttitle=mailinglistrbtitle=gbaddhere/a
 
to go back.;
     } else {
         echo There was an error in during the posting, 
please contact a 
href=\mailto:[EMAIL PROTECTED]\;the webmaster/a and he will 
fix the problem.br;
     }
 mysql_close ($Link);

but not the second one:

if (isset($Guestbook[mailinglist])) {

         if (mysql_db_query ($DBName, $Query2, $Link)) {
             echo Your e-mail address was sucessfully 
added to our mailinglist;
         } else {
             echo Your e-mail address will not be added 
to the mailinglist;
         }
     }
         
 mysql_close ($Link);
     
and yes, i am sure the checkbox is checked.

Jule    

On Tuesday 30 April 2002 23:43, you wrote:
 I don't know, every time i submit the form w/ the checkbox checked. it
 gives me the echo string which comes when the if is not executed..it adds
 the entries from the form to the guestbook table, but doesn't add the name
 and email to the mailinglist table. it doesn't give me any php or mysql
 errors.

 Jule

 On Tuesday 30 April 2002 23:35, you wrote:
  On Wednesday 01 May 2002 07:34, Jule wrote:
   Hey,
   This time it's not about missing quotes or parenthasies i hope.
   I'm trying to make a form which sends name, email, website, favsong and
   comments to table guestbook, but when the checkbox mailinglist is
   checked it should send the name and email to table mailinglist, but it
   doesn;t seem to work.
 
  We're not physic! How doesn't it work?

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] sending data to two tables.

2002-04-30 Thread Jule

Alright i'll take care of that, thanks a lot!

Jule
On Wednesday 01 May 2002 00:26, you wrote:
 On Wednesday 01 May 2002 11:48, Jule wrote:
  but not the second one:
 
  if (isset($Guestbook[mailinglist])) {

 You should be using:

 if (isset($Guestbook['mailinglist'])) {

           if (mysql_db_query ($DBName, $Query2, $Link)) {
               echo Your e-mail address was
  sucessfully added to our mailinglist;
           } else {
               echo Your e-mail address will not be
  added to the mailinglist;
           }

 Are you saying that the else clause gets executed, so you get Your e-mail
 address will not be added to the mailinglist?

 If so then your error is within:

 if (mysql_db_query ($DBName, $Query2, $Link))

 Therefore:

 1) add some error checking code -- see examples in manual and also
 mysql_error().
 2) echo your queries ($Query2)

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] $server_path

2002-04-21 Thread Jule Slootbeek

Hey guys,
i'm trying to write a  script that gets a path for a pic from mysql and then 
shows the picture.
so i added the data in teh database like so $server_path/pics/pic001.jpg and 
then when i get the final oputput the HTML says:
img src=$server_path/pics/pic001.jpg and it won't show the picture, is this 
because i'm using Mozilla 0.9.9 or is it from something else?

Jule
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] variables

2002-04-20 Thread Jule Slootbeek

Hey guys,
i have this script that changes pages in a table with the include() command, 
but i ran into trouble when i tried to change the pages by linking to 
index.php?left=theband because it would feed it to the index.php, but 
index.php would just change left back to news which is the default, how do i 
make it that it opens the theband page in stead of the default, and when i go 
to plain index.php the defaults come back?
any help apreciated
thanks

Jule
---SCRIPT---
?php

$top = navbar;
$left = news;
$righttop = welcome;
$rightbottom = pic;

$toptitle = index;
$lefttitle = index;
$righttoptitle = index;
$rightbottomtitle =index;

$extention = .php;

print (table border=0);
print (tr);
print (td align=center colspan=3);
include ($top/$toptitle$extention);
print (/td);
print (/tr);
print (tr);
print (td rowspan=2 align=center width=40%);
include ($left/$lefttitle$extention);
print (/td);
print (td align=center width=60% height=40%);
include ($righttop/$title$righttoptitle$extention);
print (/td);
print (/tr);
print (tr);
print (td align=center width=60% height=55%);
include (rightbottom/$rightbottomtitle$extention);
print (/td);
print (/tr);
print (/table);
?
---SCRIPT---
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] Images don't save

2002-04-18 Thread Jule Slootbeek

I'm not sure of it'll work, never tried it, but you might be able to show the 
pics using a Java applet..that way one cannot copy them.
Jule.
On Thursday 18 April 2002 14:17, Gunther E. Biernat typed on his or her 
keyboard, and sent me the following:
  You can't. Period. Simple as that.
  Oh, and BTW, it's not even a PHP question...

  On Thu, 18 Apr 2002 20:10:13 +0200, Manu Verhaegen wrote:
  Hi,
  You can right click on a image on your browser and choose save.
  I want to disable this option, how can i do this
  
  
  
  
  Greetings,
   Manu
  
  
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php

  Regards,

  Gunther E. Biernat

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] print on top

2002-04-17 Thread Jule Slootbeek

Hey guys and gals,
I'm writing this script for my new webpage, and i'm using MySQL to read and 
add news articles to a page, but everytime i add a new article it puts it 
under the older one, how can i get it on top?

thanks

Jule

$Link = mysql_connect ($Host, $User, $Password);
$Query = SELECT * from $TableName;
$Result = mysql_db_query ($DBName, $Query, $Link);
while ($Array = mysql_fetch_array ($Result)) {
print (table border=0 align=center valign=top width=100%);
print (tr align=center valign=top\n);
print (td align=left valign=topbi$Array[header]/i/b/td\n);
print (/tr\n);
print (tr align=center valign=top\n);
print (td align=left valign=top$Array[article]/td\n);
print (/tr\n);
print (tr align=center valign=top\n);
print (td align=right valign=topfont size=-2Posted by: $Array[name] on 
$Array[postdate]/font/td\n);
print (/tr\n);
print (/table);
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




[PHP] variable question

2002-04-15 Thread Jule Slootbeek

Hey Guys and Gals,
I'm writing this little script that takes two inputs: $name and $welcomemssg 
from a form and puts them in a text file. Now i only want to extract one of 
those variables open it with welcome.php, how do i go about this? when i just 
do fopen and fwrite it prints both variables.
any thoughts?
thanks,
Jule
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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




Re: [PHP] variable question

2002-04-15 Thread Jule Slootbeek


Here's my code, teh $welcomemssg is one of the two variable store in 
index.php the other one is $name

?php
$File = welcome/index.php;
$Open = fopen ($File, r);
if ($Open) {
print ($welcomemssg);
}
fclose ($Open);
?

Jule

On Monday 15 April 2002 13:49, you typed on your keyboard, and you sent me 
the following:
  On Tuesday 16 April 2002 00:41, Jule Slootbeek wrote:
   Hey Guys and Gals,
   I'm writing this little script that takes two inputs: $name and
   $welcomemssg from a form and puts them in a text file. Now i only want to
   extract one of those variables open it with welcome.php, how do i go
   about this? when i just do fopen and fwrite it prints both variables.
   any thoughts?

  Show us your code.

-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net

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