Re: [PHP-DB] Dynamic Email Address in an HTML table

2004-05-09 Thread John W. Holmes
PHPDiscuss - PHP Newsgroups and mailing lists wrote:

How can I create the email address in the field as a hyperlink to the
email address? 
How would you create the link normally?

mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]

right? Now if $row['email'] is equal to "[EMAIL PROTECTED]" or whatever 
you pull from the database, how would you do it? The same way...

echo "mailto:{$row['email']}\">{$row['email']}";
or

or
echo ''.$row['email'].'';
or
...
--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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


[PHP-DB] Re: Dynamic Email Address in an HTML table

2004-05-09 Thread Michael Forbes
Two alternatives:

One is to store the entire string "" in 
your field.  The other is to just store the field, but concat the string 
together when you echo/print it.  i.e.,:

print "";



Phpdiscuss - Php Newsgroups And Mailing Lists wrote:
Hello,
I have a page displaying the results of a query from a mysql database.
The final field displayed is an email address (in text datatype from the
table).
How can I create the email address in the field as a hyperlink to the
email address? Since my query loops through the database and displayes a
"row" per row in the db.
EX:
Field 1  Field 2EmailAddress
Test Test   [EMAIL PROTECTED]
In the email address field, the address shows up as text, how can I create
that as a mailto:[EMAIL PROTECTED] (or whatever the email address is).
Thank you
Terry
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DB] Dynamic Email Address in an HTML table

2004-05-09 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hello,
I have a page displaying the results of a query from a mysql database.
The final field displayed is an email address (in text datatype from the
table).
How can I create the email address in the field as a hyperlink to the
email address? Since my query loops through the database and displayes a
"row" per row in the db.

EX:
Field 1  Field 2EmailAddress
Test Test   [EMAIL PROTECTED]

In the email address field, the address shows up as text, how can I create
that as a mailto:[EMAIL PROTECTED] (or whatever the email address is).

Thank you
Terry

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



Re: [PHP-DB] supernoob strikes again

2004-05-09 Thread Dan Bowkley
I thought "4" didn't equal "456456456%20%20OR%201<>2"


- Original Message - 
From: "Uzi Klein" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 09, 2004 8:04 AM
Subject: Re: [PHP-DB] supernoob strikes again


> some input verification is recommended :
>
http://www.dibcomputers.com/new-dibcomputers/index.php?id=456456456%20%20OR%201<>2
>
>
>
>
> "Dan Bowkley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > got it...rather than return false, mysql_result throws an error if the
query
> > returns nothing.  What a pain.
> >
> > Finished product at
> > http://www.dibcomputers.com/new-dibcomputers/index.php.txt if anyone
wants
> > to steal it...
> >
> > D
> > - Original Message - 
> > From: "Dan Bowkley" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Saturday, May 08, 2004 11:21 PM
> > Subject: Re: [PHP-DB] supernoob strikes again
> >
> >
> > > The 404 page is also inserted into the template, or at least that's
the
> > > idea...index.html?id=404 is the error page.  ?id=1 is the main page,
other
> > > pages are numbered accordingly.
> > >
> > >
> > > - Original Message - 
> > > From: "Justin Gruenberg" <[EMAIL PROTECTED]>
> > > To: "Dan Bowkley" <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Saturday, May 08, 2004 11:05 PM
> > > Subject: Re: [PHP-DB] supernoob strikes again
> > >
> > >
> > > > Dan Bowkley wrote:
> > > >
> > > > >Yeah, I'm back...
> > > > >
> > > > >I'm revamping my own site, finally...going for the same sort of
dynamic
> > > system I was using for my last creation.  Currently, I have index.php
> > > returning lots of different pages from a mysql database; what I'd like
to
> > do
> > > is have a somewhat more elegant solution for spitting back a 404 page.
> > > > >
> > > > >
> > > >
> > > > I'm not entirely sure if I understand your problem, but I can try.
It's
> > > > a bit late.
> > > >
> > > > What you need is to test to see if 0 rows are returned.  Do this
before
> > > > any HTML is outputted.  You can use header("HTTP/1.0 404 Not Found")
to
> > > > tell the browser that the page wasn't found.  You want to stop any
> > > > output after that, too.  If you use Apache, you can use a custom
error
> > > > document to give a pretty error page.
> > > >
> > > > See
> > > > http://us4.php.net/manual/en/function.header.php
> > > > http://httpd.apache.org/docs/mod/core.html#errordocument
> > > >
> > > >
> > > >
> > > >
> > >
> > > -- 
> > > PHP Database Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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



[PHP-DB] Re: another strange MYSQL problem

2004-05-09 Thread Kim Steinhaug
What I suggest you do, run phpMyAdmin (Or whatever you use)
and dump the table structure for your table. Also give us a few lines
of typical data from your table.

Your queries looks correct to me.

-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--


<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> First, I use this, and all is ok:
>
> SELECT * FROM modele WHERE marca='Aprilia' ORDER BY tip ASC.
>
> Then, I use this:
>
> SELECT  * FROM modele WHERE marca='Cagiva' ORDER BY tip ASC
>
> and the records are not ordered ascending by the field tip. In the
> first case, the records were ordered. Anyone knows what is wrong?
> Thank you!
>
> Best regards,
> Marius Panaitescu

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



Re: [PHP-DB] Procedure for submitting an order via email

2004-05-09 Thread Kim Steinhaug
You dont want an example, you are looking for a finnished piece of
code to glue into your site.

Your asking for a given example of a not given system? Different
stores uses different ways of collecting data. Some databases,
some cookies, some even stores the basket in sessions. Throwing
a form fields into the mix doesnt make the question easier to answer.

What you are asking in car repair terms would be something like :
How do I repaird the engine?

Either come with more information, and accuall code you are using,
then some people here might be able to supply you with the answers
you are looking for.

-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Ruprecht Helms" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 1 May 2004 at 22:47, Ignatius Reilly wrote:
>
> > With the PHP IMAP functions you can process your mail box
programmatically
> > as a data repository.
>
> nice to know. What I want is an scriptexample for a checkoutprocedure of a
> online-store. I want submit via email the content of a basket, that is
stored in a
> databasetable, some formfields and the mailreceiver taken from another
databasetable.
>
> Regards,
> Ruprecht
>
> 
> Ruprecht Helms IT-Service & Softwareentwicklung
>
> Tel./Fax +49[0]7621 16 99 16
>
> Web:  http://www.rheyn.de
> email:[EMAIL PROTECTED]

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



[PHP-DB] Re: merging a table from multiple servers

2004-05-09 Thread Kim Steinhaug
Well,

I would do the following, lets assume some servers here :
Server1 - Your server
Server2 - Someone you want data from
Server3 - Another one you want data from

I would create a script which must be installed on every server you need
data from, call it generate.php for example. This script would pull out
all the data your would want to use on your site, format the the data
however youd like it, as a CSV file, MySQL queries or whatever.
Each generate script will write back to the file : batch.txt for example.
(Or it could spit out the results as you trigger the scrupt, but incase
there
are many servers you would encounter the 30second limit on PHP scripts).
For the case of argument we say that the generate.php script spits out
the results the way you want them.

What your server would need to do then would be the following :
You could use fopen to trigger each generate.php file like this from your
site :

--->
function fetchpage($page){
 $fd=fopen($page,"r");
 while ($line=fgets($fd,1000)) { $text.=$line; } fclose ($fd);
return $text;
}
$data2 = fetchpage('http://server2/generate.php');
$data3 = fetchpage('http://server3/generate.php');
--->

You now have all you need in $data and $data2, you would then
pull your own stats into $data1 and do whatever you like with this.
You could pump all the results into a new table for statistics, or
do it at once and present the result as a HTML.

You should also create a trigger or something for this script so that
it doesnt run on every pageload, maby once an hour or something.

I hope you got the the hang of it.

-- 
-- 
Kim Steinhaug
--
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
--
www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
--

"Seth Bembeneck" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How would I generate the file?
> Make each record 1 line in the file?
>
> After the file is created, how do I download it?
>
> Thanks,
>
> Seth
>
> "Kim Steinhaug" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > I would imagine the best way would be a system that triggers a
> > script on the different serveres. This script creates a datafile
> > which you import with fopen and then you create the database
> > set you need to generate nice stats from.
> >
> > Else you would need the different servers to accept incoming
> > connections on their MySQL from your host, which I would think
> > would be alot of work to accomplish. Preparing datasets on the
> > different servers with a script sounds much more simple in my
> > opinion, after all this script will only be "updated" at given
> > intervals.
> >
> > -- 
> > -- 
> > Kim Steinhaug
> > --
> > There are 10 types of people when it comes to binary numbers:
> > those who understand them, and those who don't.
> > --
> > www.steinhaug.com - www.easywebshop.no - www.webkitpro.com
> > --
> >
> > "Seth Bembeneck" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> > > I'm trying to work on a project that gathers info from different
> servers,
> > > then combines them and displays it.
> > >
> > > Is it possble to merge the tables from the different servers into 1
> table
> > > using php?
> > >
> > > My one solution to this was to have a php script on each server, then
> have
> > > my website call each php script, retrieve the info then insert it into
> my
> > > database.
> > >
> > > For a glimps of the amount of data I'm trying to merge:
> > > http://cwhq.net/index.php?action=stats&mod=kill_stats_totals
> > >
> > > Now imagine 10 different servers with similer data.
> > >
> > > I'm trying to provide a way for Deltaforce Gamers to see their stat
from
> > all
> > > the game servers that collect the stats in 1 location.
> > >
> > > Thanks,
> > >
> > > Seth
> > >
>

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



Re: [PHP-DB] supernoob strikes again

2004-05-09 Thread Doug Thompson
Dan Bowkley wrote:
got it...rather than return false, mysql_result throws an error if the query
returns nothing.  What a pain.
NOT True.

If the query is syntactically valid and nothing matches, mysql returns zero rows which is not an error, at least on the part of the dbms.  Use mysql_num_rows() to test for this condition.

Doug

Finished product at
http://www.dibcomputers.com/new-dibcomputers/index.php.txt if anyone wants
to steal it...
D
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DB] supernoob strikes again

2004-05-09 Thread Uzi Klein
some input verification is recommended :
http://www.dibcomputers.com/new-dibcomputers/index.php?id=456456456%20%20OR%201<>2




"Dan Bowkley" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> got it...rather than return false, mysql_result throws an error if the query
> returns nothing.  What a pain.
>
> Finished product at
> http://www.dibcomputers.com/new-dibcomputers/index.php.txt if anyone wants
> to steal it...
>
> D
> - Original Message - 
> From: "Dan Bowkley" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, May 08, 2004 11:21 PM
> Subject: Re: [PHP-DB] supernoob strikes again
>
>
> > The 404 page is also inserted into the template, or at least that's the
> > idea...index.html?id=404 is the error page.  ?id=1 is the main page, other
> > pages are numbered accordingly.
> >
> >
> > - Original Message - 
> > From: "Justin Gruenberg" <[EMAIL PROTECTED]>
> > To: "Dan Bowkley" <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Saturday, May 08, 2004 11:05 PM
> > Subject: Re: [PHP-DB] supernoob strikes again
> >
> >
> > > Dan Bowkley wrote:
> > >
> > > >Yeah, I'm back...
> > > >
> > > >I'm revamping my own site, finally...going for the same sort of dynamic
> > system I was using for my last creation.  Currently, I have index.php
> > returning lots of different pages from a mysql database; what I'd like to
> do
> > is have a somewhat more elegant solution for spitting back a 404 page.
> > > >
> > > >
> > >
> > > I'm not entirely sure if I understand your problem, but I can try.  It's
> > > a bit late.
> > >
> > > What you need is to test to see if 0 rows are returned.  Do this before
> > > any HTML is outputted.  You can use header("HTTP/1.0 404 Not Found") to
> > > tell the browser that the page wasn't found.  You want to stop any
> > > output after that, too.  If you use Apache, you can use a custom error
> > > document to give a pretty error page.
> > >
> > > See
> > > http://us4.php.net/manual/en/function.header.php
> > > http://httpd.apache.org/docs/mod/core.html#errordocument
> > >
> > >
> > >
> > >
> >
> > -- 
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >

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



Re: [PHP-DB] supernoob strikes again

2004-05-09 Thread Dan Bowkley
got it...rather than return false, mysql_result throws an error if the query
returns nothing.  What a pain.

Finished product at
http://www.dibcomputers.com/new-dibcomputers/index.php.txt if anyone wants
to steal it...

D
- Original Message - 
From: "Dan Bowkley" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, May 08, 2004 11:21 PM
Subject: Re: [PHP-DB] supernoob strikes again


> The 404 page is also inserted into the template, or at least that's the
> idea...index.html?id=404 is the error page.  ?id=1 is the main page, other
> pages are numbered accordingly.
>
>
> - Original Message - 
> From: "Justin Gruenberg" <[EMAIL PROTECTED]>
> To: "Dan Bowkley" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Saturday, May 08, 2004 11:05 PM
> Subject: Re: [PHP-DB] supernoob strikes again
>
>
> > Dan Bowkley wrote:
> >
> > >Yeah, I'm back...
> > >
> > >I'm revamping my own site, finally...going for the same sort of dynamic
> system I was using for my last creation.  Currently, I have index.php
> returning lots of different pages from a mysql database; what I'd like to
do
> is have a somewhat more elegant solution for spitting back a 404 page.
> > >
> > >
> >
> > I'm not entirely sure if I understand your problem, but I can try.  It's
> > a bit late.
> >
> > What you need is to test to see if 0 rows are returned.  Do this before
> > any HTML is outputted.  You can use header("HTTP/1.0 404 Not Found") to
> > tell the browser that the page wasn't found.  You want to stop any
> > output after that, too.  If you use Apache, you can use a custom error
> > document to give a pretty error page.
> >
> > See
> > http://us4.php.net/manual/en/function.header.php
> > http://httpd.apache.org/docs/mod/core.html#errordocument
> >
> >
> >
> >
>
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

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



[PHP-DB] narrowing it down...

2004-05-09 Thread Dan Bowkley
I've come up with this:
if (mysql_result ( mysql_query ("SELECT id FROM dibcomp_site WHERE id = 
$page_req"),0)) {$thisid = "404";} else {$thisid = $page_req;}



and, well, it doesn't work.  I think it really ought to...