CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 Modify links pulled from database

Print topic Send  topic

Author Message
Madlobster
Posted: 06/20/2003, 7:54 AM

I have a database that contains a list of hyperlinks with ids and a column
that contains a counter for the number of times the link has been clicked on
my site. Any time I present a link from this table to the user, I would
like modify the link to a) open in a new window and b) increase the counter.

I know how to accomplish this in html and php code, but I don't know how to
use the interface to accomplish this.

For example, each link's hyperlink would look something like this in the
resulting page:
<a href="go.php?site=http://www.yahoo.com" TARGET="_top">Visit Yahoo</a>
<a href="go.php?site=http://www.hp.com" TARGET="_top">Visit HP</a>
<a href="go.php?site=http://www.google.com" TARGET="_top">Visit Google</a>

The link portion (http://www.yahoo.com, for example) will be pulled from the
database. All of the other tag information has to be wrapped around each
one.

The go.php script contains the code that will update the counter in the
database.

Anyone have any ideas on how to accomplish this in the CodeCharge Studio
IDE?

DonB
Posted: 06/20/2003, 12:55 PM

In the BeforeShow event of the link control, you can put in code to modify
the link any way you like.

Assuming the link control is named "Link1" then http://www.yahoo.com will
be in Link1->Link and you can use that as as basis for building the new
value that you would then stuff back into the Link property.

DonB


"Madlobster" <mehave@noemail.com> wrote in message
news:bcv77n$je3$1@news.codecharge.com...
> I have a database that contains a list of hyperlinks with ids and a column
> that contains a counter for the number of times the link has been clicked
on
> my site. Any time I present a link from this table to the user, I would
> like modify the link to a) open in a new window and b) increase the
counter.
>
> I know how to accomplish this in html and php code, but I don't know how
to
> use the interface to accomplish this.
>
> For example, each link's hyperlink would look something like this in the
> resulting page:
> <a href="go.php?site=http://www.yahoo.com" TARGET="_top">Visit Yahoo</a>
> <a href="go.php?site=http://www.hp.com" TARGET="_top">Visit HP</a>
> <a href="go.php?site=http://www.google.com" TARGET="_top">Visit Google</a>
>
> The link portion (http://www.yahoo.com, for example) will be pulled from
the
> database. All of the other tag information has to be wrapped around each
> one.
>
> The go.php script contains the code that will update the counter in the
> database.
>
> Anyone have any ideas on how to accomplish this in the CodeCharge Studio
> IDE?
>
>

DonB
Posted: 06/20/2003, 1:00 PM

Oh, and, you will need to change the datasource for the link from "Database
Column" to "Code Expression"

DonB


"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:bcvos8$ool$1@news.codecharge.com...
> In the BeforeShow event of the link control, you can put in code to modify
> the link any way you like.
>
> Assuming the link control is named "Link1" then http://www.yahoo.com will
> be in Link1->Link and you can use that as as basis for building the new
> value that you would then stuff back into the Link property.
>
> DonB
>
>
> "Madlobster" <mehave@noemail.com> wrote in message
>news:bcv77n$je3$1@news.codecharge.com...
> > I have a database that contains a list of hyperlinks with ids and a
column
> > that contains a counter for the number of times the link has been
clicked
> on
> > my site. Any time I present a link from this table to the user, I would
> > like modify the link to a) open in a new window and b) increase the
> counter.
> >
> > I know how to accomplish this in html and php code, but I don't know how
> to
> > use the interface to accomplish this.
> >
> > For example, each link's hyperlink would look something like this in the
> > resulting page:
> > <a href="go.php?site=http://www.yahoo.com" TARGET="_top">Visit Yahoo</a>
> > <a href="go.php?site=http://www.hp.com" TARGET="_top">Visit HP</a>
> > <a href="go.php?site=http://www.google.com" TARGET="_top">Visit
Google</a>
> >
> > The link portion (http://www.yahoo.com, for example) will be pulled from
> the
> > database. All of the other tag information has to be wrapped around
each
> > one.
> >
> > The go.php script contains the code that will update the counter in the
> > database.
> >
> > Anyone have any ideas on how to accomplish this in the CodeCharge Studio
> > IDE?
> >
> >
>
>

DonB
Posted: 06/20/2003, 1:08 PM

Well, I'm really getting myself in trouble this time. Seems PHP is
different than ASP syntactically for the Link property. Use
Link1->Setlink(url). And, so that it opens in a new window, just set (at
design time) the "target" to "_top" or whatever you like. Yout can't change
that a runtime. If you want the choice of new window or not, then you'll
have to put two links on the page and make one visible and the other one not
visible (visibility CAN be changed at run time). Put the "_top" target in
one. Then you can choose whiehever one you want at run time. In you case
it sounds like you don't need to change this at runtime, and if this is the
case you can stick with just one Link and hardwire the target for it.

DonB

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:bcvp4s$pfd$1@news.codecharge.com...
> Oh, and, you will need to change the datasource for the link from
"Database
> Column" to "Code Expression"
>
> DonB
>
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:bcvos8$ool$1@news.codecharge.com...
> > In the BeforeShow event of the link control, you can put in code to
modify
> > the link any way you like.
> >
> > Assuming the link control is named "Link1" then http://www.yahoo.com
will
> > be in Link1->Link and you can use that as as basis for building the new
> > value that you would then stuff back into the Link property.
> >
> > DonB
> >
> >
> > "Madlobster" <mehave@noemail.com> wrote in message
> >news:bcv77n$je3$1@news.codecharge.com...
> > > I have a database that contains a list of hyperlinks with ids and a
> column
> > > that contains a counter for the number of times the link has been
> clicked
> > on
> > > my site. Any time I present a link from this table to the user, I
would
> > > like modify the link to a) open in a new window and b) increase the
> > counter.
> > >
> > > I know how to accomplish this in html and php code, but I don't know
how
> > to
> > > use the interface to accomplish this.
> > >
> > > For example, each link's hyperlink would look something like this in
the
> > > resulting page:
> > > <a href="go.php?site=http://www.yahoo.com" TARGET="_top">Visit
Yahoo</a>
> > > <a href="go.php?site=http://www.hp.com" TARGET="_top">Visit HP</a>
> > > <a href="go.php?site=http://www.google.com" TARGET="_top">Visit
> Google</a>
> > >
> > > The link portion (http://www.yahoo.com, for example) will be pulled
from
> > the
> > > database. All of the other tag information has to be wrapped around
> each
> > > one.
> > >
> > > The go.php script contains the code that will update the counter in
the
> > > database.
> > >
> > > Anyone have any ideas on how to accomplish this in the CodeCharge
Studio
> > > IDE?
> > >
> > >
> >
> >
>
>

Madlobster
Posted: 06/23/2003, 6:33 AM

DonB,

Thanks for all of your help. I truly appreciate it.

Madlobster

"DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
news:bcvpk0$qdu$1@news.codecharge.com...
> Well, I'm really getting myself in trouble this time. Seems PHP is
> different than ASP syntactically for the Link property. Use
> Link1->Setlink(url). And, so that it opens in a new window, just set (at
> design time) the "target" to "_top" or whatever you like. Yout can't
change
> that a runtime. If you want the choice of new window or not, then you'll
> have to put two links on the page and make one visible and the other one
not
> visible (visibility CAN be changed at run time). Put the "_top" target in
> one. Then you can choose whiehever one you want at run time. In you case
> it sounds like you don't need to change this at runtime, and if this is
the
> case you can stick with just one Link and hardwire the target for it.
>
> DonB
>
> "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
>news:bcvp4s$pfd$1@news.codecharge.com...
> > Oh, and, you will need to change the datasource for the link from
> "Database
> > Column" to "Code Expression"
> >
> > DonB
> >
> >
> > "DonB" <7432D63DBB01D03A196B1EDD80E8@comcast.net> wrote in message
> >news:bcvos8$ool$1@news.codecharge.com...
> > > In the BeforeShow event of the link control, you can put in code to
> modify
> > > the link any way you like.
> > >
> > > Assuming the link control is named "Link1" then http://www.yahoo.com
> will
> > > be in Link1->Link and you can use that as as basis for building the
new
> > > value that you would then stuff back into the Link property.
> > >
> > > DonB
> > >
> > >
> > > "Madlobster" <mehave@noemail.com> wrote in message
> > >news:bcv77n$je3$1@news.codecharge.com...
> > > > I have a database that contains a list of hyperlinks with ids and a
> > column
> > > > that contains a counter for the number of times the link has been
> > clicked
> > > on
> > > > my site. Any time I present a link from this table to the user, I
> would
> > > > like modify the link to a) open in a new window and b) increase the
> > > counter.
> > > >
> > > > I know how to accomplish this in html and php code, but I don't know
> how
> > > to
> > > > use the interface to accomplish this.
> > > >
> > > > For example, each link's hyperlink would look something like this in
> the
> > > > resulting page:
> > > > <a href="go.php?site=http://www.yahoo.com" TARGET="_top">Visit
> Yahoo</a>
> > > > <a href="go.php?site=http://www.hp.com" TARGET="_top">Visit HP</a>
> > > > <a href="go.php?site=http://www.google.com" TARGET="_top">Visit
> > Google</a>
> > > >
> > > > The link portion (http://www.yahoo.com, for example) will be pulled
> from
> > > the
> > > > database. All of the other tag information has to be wrapped around
> > each
> > > > one.
> > > >
> > > > The go.php script contains the code that will update the counter in
> the
> > > > database.
> > > >
> > > > Anyone have any ideas on how to accomplish this in the CodeCharge
> Studio
> > > > IDE?
> > > >
> > > >
> > >
> > >
> >
> >
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.