Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help Again: Creating a web link using HTML, php and MySQL. Help

0 views
Skip to first unread message

Norbert...@yahoo.com

unread,
Feb 18, 2008, 12:19:04 PM2/18/08
to
I am new in all this php, html, etc world.
I just want to use a link that will send the person to a external
webpage.
The first link works:
echo "<tr><th><a href='{$info['website2']}'>Click Here!</a></th>";
But when I try to get back to it, does not work. I tried using
constant TESTCONS but it does not work. I checked and I still have
the correct value in TESTCONS but I cannot get it out in the link.
Help.

You want to see this code, please visit:
http://goji3000.com/Atestgojicreated.php


<html>
<title>HTML with PHP</title>
<body>
<h1></h1>

<html>
</html>

<?php
// Connects to your Database
mysql_connect("mysql", "user", "password") or die(mysql_error());
mysql_select_db("socios") or die(mysql_error());
$data = mysql_query("SELECT * FROM `informacion` WHERE `key` =
673538")
or die(mysql_error());

while($info = mysql_fetch_array( $data ))
{
echo "<tr><th><a href='{$info['website2']}'>Click Here!</a></th>";

define("TESTCONS", "{$info['website2']}");
}
?>
</body>
<html> THIS IS ANOTHER TEST.</html>
<div align="center"><?PHP
ECHO TESTCONS; ?>

<html> THIS IS ANOTHER TEST.</html>
<?PHP
ECHO "<tr><th><a href=(TESTCONS)>enter!</a></th>";
?>

Norbert...@yahoo.com

unread,
Feb 18, 2008, 11:26:26 PM2/18/08
to
On Feb 18, 1:19 pm, "Norberto_Riv...@yahoo.com"

Help... Why the value of TESTCONS is not visible. I have defined it
as Constant.

Norbert...@yahoo.com

unread,
Feb 19, 2008, 12:08:13 AM2/19/08
to
On Feb 19, 12:26 am, "Norberto_Riv...@yahoo.com"
> as Constant.- Hide quoted text -
>
> - Show quoted text -


OK, I resolved the problem.
Simple, I assigned the constant to a variable.
that's it.
If you want to see this code working go to:
http://goji3000.com/Atestgojicreated.php

Here is the code:
=============================


<html>
<title>HTML with PHP</title>
<body>
<h1></h1>
<html>

</html>

<?php
// Connects to your Database
mysql_connect("mysql", "user", "password") or die(mysql_error());
mysql_select_db("socios") or die(mysql_error());
$data = mysql_query("SELECT * FROM `informacion` WHERE `key` =
673538")
or die(mysql_error());
while($info = mysql_fetch_array( $data ))
{
echo "<tr><th><a href='{$info['website2']}'>Click Here!</a></th>";
define("TESTCONS", "{$info['website2']}");
}
?>

</body>

<div align="center"><?PHP $test1 = TESTCONS; ?>

<html> ANTES DEL LINK.</html>
<?PHP ECHO "<tr><th><a href=$test1>enter!</a></th>"; ?>
<html> DESPUES DEL LINK.</html>
++++++++++++++++++++++++++++++++++++++++++++

Jerry Stuckle

unread,
Feb 19, 2008, 6:42:44 AM2/19/08
to

...

echo TESTCONS;

...
echo '<tr><th><a href="' . TESTCONS . '">enter!</a></th>';

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstu...@attglobal.net
==================

Norbert...@yahoo.com

unread,
Feb 25, 2008, 4:22:26 PM2/25/08
to
On Feb 19, 1:08 am, "Norberto_Riv...@yahoo.com"
> ++++++++++++++++++++++++++++++++++++++++++++- Hide quoted text -

>
> - Show quoted text -

This is working perfect for me. Now, I need a little bit of more
help:
I would like to use this link but this time with an image.
Volunteers!? Thanks....

0 new messages