PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.php > Again: Creating a web link using HTML, php and MySQL.
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Again: Creating a web link using HTML, php and MySQL.

Réponse
 
LinkBack Outils de la discussion
Vieux 18/02/2008, 17h19   #1
Norberto_Rivera@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Again: Creating a web link using HTML, php and MySQL.

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

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>";
?>
  Réponse avec citation
Vieux 19/02/2008, 04h26   #2
Norberto_Rivera@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Again: Creating a web link using HTML, php and MySQL.

On Feb 18, 1:19pm, "Norberto_Riv...@yahoo.com"
<Norberto_Riv...@yahoo.com> wrote:
> 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.
> .
>
> 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>";
> ?>


... Why the value of TESTCONS is not visible. I have defined it
as Constant.
  Réponse avec citation
Vieux 19/02/2008, 05h08   #3
Norberto_Rivera@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Again: Creating a web link using HTML, php and MySQL.

On Feb 19, 12:26am, "Norberto_Riv...@yahoo.com"
<Norberto_Riv...@yahoo.com> wrote:
> On Feb 18, 1:19pm, "Norberto_Riv...@yahoo.com"
>
>
>
>
>
> <Norberto_Riv...@yahoo.com> wrote:
> > 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.
> > .

>
> > 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>";
> > ?>

>
> ... Why the value of TESTCONS is not visible. I have defined it
> 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>
++++++++++++++++++++++++++++++++++++++++++++
  Réponse avec citation
Vieux 19/02/2008, 11h42   #4
Jerry Stuckle
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Again: Creating a web link using HTML, php and MySQL.

Norberto_Rivera@yahoo.com wrote:
> 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.
> .
>
> 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>";
> ?>
>


define("TESTCONS", $info['website2']);
....

echo TESTCONS;

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

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

  Réponse avec citation
Vieux 25/02/2008, 21h22   #5
Norberto_Rivera@yahoo.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Again: Creating a web link using HTML, php and MySQL.

On Feb 19, 1:08am, "Norberto_Riv...@yahoo.com"
<Norberto_Riv...@yahoo.com> wrote:
> On Feb 19, 12:26am, "Norberto_Riv...@yahoo.com"
>
>
>
>
>
> <Norberto_Riv...@yahoo.com> wrote:
> > On Feb 18, 1:19pm, "Norberto_Riv...@yahoo.com"

>
> > <Norberto_Riv...@yahoo.com> wrote:
> > > 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.
> > >.

>
> > > 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>";
> > > ?>

>
> >... Why the value of TESTCONS is not visible. I have defined it
> > 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>
> ++++++++++++++++++++++++++++++++++++++++++++- Hide quoted text -
>
> - Show quoted text -


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


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 18h19.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,19347 seconds with 13 queries