CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 PHP - simple link - custom code

Print topic Send  topic

Author Message
michael weaver
Posted: 07/17/2002, 9:33 AM

Hi,

This works - I just wanted to check with someone else. Using PHP, I'm trying
to take a database field, and make it a mailto: link. Simple enough. But is
this the best way?

grid name = 'client'
affected field = 'email'
Before Show > Custom Code

// -------------------------
global $client;
$new_email = $client->email->GetValue();
$client->email->SetValue("<a href='mailto:" . $new_email . "'>" . $new_email
.. "</a>");
// -------------------------

It works just fine. But am I throwing in too many steps? Am I missing
something?

Thanks.

--
michael a. weaver

Geert van der Ploeg
Posted: 07/18/2002, 12:52 AM

The "visual" way of making a HREF is to add a "link field" in your design
page.

The description of the "Source/parameters" property of a link, talks about
"Page path, database field or custom expression containing the URL".

So, I think It should be possible to make a mailto: link from that,
including the $client->email->getvalue() value.

But at this moment, when clicking the "..." on that property, I can only
choose a "Page"-type.

Maybe the other options (database field or custom expression) are left to
implement at a later time?
Maybe a CCS developer could shine a light on this?


Regards

--

Geert van der Ploeg
Triple IT


"michael weaver" <zero@michaelweaver.org> wrote in message
news:ah4693$87o$1@news.codecharge.com...
> Hi,
>
> This works - I just wanted to check with someone else. Using PHP, I'm
trying
> to take a database field, and make it a mailto: link. Simple enough. But
is
> this the best way?
>
> grid name = 'client'
> affected field = 'email'
> Before Show > Custom Code
>
> // -------------------------
> global $client;
> $new_email = $client->email->GetValue();
> $client->email->SetValue("<a href='mailto:" . $new_email . "'>" .
$new_email
> . "</a>");
> // -------------------------
>
> It works just fine. But am I throwing in too many steps? Am I missing
> something?
>
> Thanks.
>
> --
> michael a. weaver
>
>

Simon Chee
Posted: 07/18/2002, 2:48 AM

I did this

Created a link in the normal way for a database field called Member_Email.

click on the link in design mode and choose the format tab.

The href field should contain {fldname_Src}

Add mailto: to make this:

mailto:{Member_Email_Src}

Example @ :

http://www.masheads.com/league


"michael weaver" <zero@michaelweaver.org> wrote in message
news:ah4693$87o$1@news.codecharge.com...
> Hi,
>
> This works - I just wanted to check with someone else. Using PHP, I'm
trying
> to take a database field, and make it a mailto: link. Simple enough. But
is
> this the best way?
>
> grid name = 'client'
> affected field = 'email'
> Before Show > Custom Code
>
> // -------------------------
> global $client;
> $new_email = $client->email->GetValue();
> $client->email->SetValue("<a href='mailto:" . $new_email . "'>" .
$new_email
> . "</a>");
> // -------------------------
>
> It works just fine. But am I throwing in too many steps? Am I missing
> something?
>
> Thanks.
>
> --
> michael a. weaver
>
>

michael weaver
Posted: 07/18/2002, 9:05 AM

Wow - I REALLY over-thought this one! I right-clicked, chose change to >
link, added mailto: to the HTML, and was done. I'm a moron.

I guess my real question is concerning the difference between CC and CCS. In
CC, using php, I would use something like this in Before Show:

$fldfield_name = nl2br($fldfield_name);
or
$fldfield_name = $fldfield_name + $fldfield_name2;
or
$fldfield_name = ltrim($fldfield_name);
.... et cetera.

Is the new way to affect a variable something like this?

global $form_name;
$new_variable = $form_name->field_name->GetValue();
$form_name->field_name->SetValue("do_whatever($new_variable)");

Thanks for the help!

michael



"Simon Chee" <darkblade@darkblade.fslife.co.uk> wrote in message
news:ah62t1$k5c$1@news.codecharge.com...
> I did this
>
> Created a link in the normal way for a database field called Member_Email.
>
> click on the link in design mode and choose the format tab.
>
> The href field should contain {fldname_Src}
>
> Add mailto: to make this:
>
> mailto:{Member_Email_Src}
>
> Example @ :
>
> http://www.masheads.com/league
>
>
> "michael weaver" <zero@michaelweaver.org> wrote in message
>news:ah4693$87o$1@news.codecharge.com...
> > Hi,
> >
> > This works - I just wanted to check with someone else. Using PHP, I'm
> trying
> > to take a database field, and make it a mailto: link. Simple enough. But
> is
> > this the best way?
> >
> > grid name = 'client'
> > affected field = 'email'
> > Before Show > Custom Code
> >
> > // -------------------------
> > global $client;
> > $new_email = $client->email->GetValue();
> > $client->email->SetValue("<a href='mailto:" . $new_email . "'>" .
> $new_email
> > . "</a>");
> > // -------------------------
> >
> > It works just fine. But am I throwing in too many steps? Am I missing
> > something?
> >
> > Thanks.
> >
> > --
> > michael a. weaver
> >
> >
>
>

michael weaver
Posted: 07/18/2002, 9:08 AM

I think that's what confused me. I thought CCS required that it go to a
page, rather than leaving it alone and letting it take the field data
automatically as the link info. I just changed the field type to a link and
added mailto: to the HTML and it works perfectly.

Thanks for the help!

michael


"Geert van der Ploeg" <news@geert.triple-it.nl> wrote in message
news:ah5s3t$89h$1@news.codecharge.com...
> The "visual" way of making a HREF is to add a "link field" in your design
> page.
>
> The description of the "Source/parameters" property of a link, talks about
> "Page path, database field or custom expression containing the URL".
>
> So, I think It should be possible to make a mailto: link from that,
> including the $client->email->getvalue() value.
>
> But at this moment, when clicking the "..." on that property, I can only
> choose a "Page"-type.
>
> Maybe the other options (database field or custom expression) are left to
> implement at a later time?
> Maybe a CCS developer could shine a light on this?
>
>
> Regards
>
> --
>
> Geert van der Ploeg
> Triple IT
>
>
> "michael weaver" <zero@michaelweaver.org> wrote in message
>news:ah4693$87o$1@news.codecharge.com...
> > Hi,
> >
> > This works - I just wanted to check with someone else. Using PHP, I'm
> trying
> > to take a database field, and make it a mailto: link. Simple enough. But
> is
> > this the best way?
> >
> > grid name = 'client'
> > affected field = 'email'
> > Before Show > Custom Code
> >
> > // -------------------------
> > global $client;
> > $new_email = $client->email->GetValue();
> > $client->email->SetValue("<a href='mailto:" . $new_email . "'>" .
> $new_email
> > . "</a>");
> > // -------------------------
> >
> > It works just fine. But am I throwing in too many steps? Am I missing
> > something?
> >
> > Thanks.
> >
> > --
> > michael a. weaver
> >
> >
>
>


   


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.