| | |
make a link from an array variable
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
Hello everybody,
anyone can help me with this problem?
instead of just display the child (in array)..echo $Valuechild[$i]."; ";
(see the below code)..I would like to make a link from $Valuechild[$i] to a details of that variable..
I have done like this..
however there is an error on that line.
thank you
anyone can help me with this problem?
instead of just display the child (in array)..echo $Valuechild[$i]."; ";
(see the below code)..I would like to make a link from $Valuechild[$i] to a details of that variable..
php Syntax (Toggle Plain Text)
<TEXTAREA NAME="comments3" style='width:50%' rows='4'> <?php for ($i =0; $i < $ValuenumtableChildren; $i++) { //$showsibling = $showsibling.$Valuechild[$i]."; "; echo $Valuechild[$i]."; "; ?> <?php } ?> </TEXTAREA>
I have done like this..
php Syntax (Toggle Plain Text)
<a href="viewingdetails.php?name=<?php echo $Valuesibling[$i]."?></a>;
however there is an error on that line.
thank you
Last edited by tulipputih; Jun 25th, 2009 at 9:41 am.
Is this what you mean?
php Syntax (Toggle Plain Text)
<TEXTAREA NAME="comments3" style='width:50%' rows='4'> <?php for ($i =0; $i < $ValuenumtableChildren; $i++) { echo '<a href="viewingdetails.php?name='.$Valuechild[$i].'</a>'; } ?> </TEXTAREA>
Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - Oopy Doopy Do 2U2!
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - Oopy Doopy Do 2U2!
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
thanks for your response.
yes..I have tried this beforebut it appears like this:
what I need to do is to make a like from Science & Matter in Nature..or whatever .$Valuechild[$i]. is to a detail page.
hope someone can help me.
•
•
•
•
Is this what you mean?
html Syntax (Toggle Plain Text)
<a href="viewingdetails.php?name=Science</a> <a href="viewingdetails.php?name=Matter in Nature</a>
what I need to do is to make a like from Science & Matter in Nature..or whatever .$Valuechild[$i]. is to a detail page.
hope someone can help me.
Last edited by peter_budo; Jun 26th, 2009 at 4:10 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
Join Date: Jun 2009
Posts: 13
Reputation:
Solved Threads: 1
This:
Should be this:
<a href="viewingdetails.php?name=<?php echo $Valuesibling[$i]."?></a>; Should be this:
<a href="viewingdetails.php?name=<?php echo .$Valuesibling[$i].?>"</a>; Last edited by peter_budo; Jun 26th, 2009 at 4:12 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
•
•
•
•
any other suggestion?
$Valuechild=array(); and check that it also uses the right casing because I can only see half the picture here. Try not to bump 10 year old threads as it can be really annoying.
http://syntax.cwarn23.net/
My favourite PC. - Oopy Doopy Do 2U2!
http://syntax.cwarn23.net/
Smilies: ^_* +_+ v_v -_- *~*` My favourite PC. - Oopy Doopy Do 2U2!
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
Hi..this is the code. I am sorry if this is not what you mean..
If it doens't..could you please explain..what should I provide here..thank you.
If it doens't..could you please explain..what should I provide here..thank you.
•
•
•
•
Is this what you mean?
php Syntax (Toggle Plain Text)
<TEXTAREA NAME="comments3" style='width:50%' rows='4'> <?php for ($i =0; $i < $ValuenumtableChildren; $i++) { echo '<a href="viewingdetails.php?name='.$Valuechild[$i].'</a>'; } ?> </TEXTAREA>
Hi there, from the past couple of posts, you guys are on the right track, it just seems that no-one remembered to close the anchor tag properly, it should be like this:
PHP Syntax (Toggle Plain Text)
# <?php # for ($i =0; $i < $ValuenumtableChildren; $i++) # { # echo '<a href="viewingdetails.php?name='.$Valuechild[$i].'">LINK TEXT GOES HERE</a>'; # } # ?>
$me = new Person();
if (isset($_COOKIE)){
$me->eat($_COOKIE);
} else { $me->starve(); }
if (isset($_COOKIE)){
$me->eat($_COOKIE);
} else { $me->starve(); }
•
•
Join Date: May 2009
Posts: 81
Reputation:
Solved Threads: 0
hi..
I have tried that one as well..
the same output displayed.. (as below)
Matter in Nature should be underlined, to be linked to the detail page.
any help??
thanks
I have tried that one as well..
the same output displayed.. (as below)
<a href="viewingdetails.php?name=Matter in Nature">LINK TEXT GOES HERE</a> Matter in Nature should be underlined, to be linked to the detail page.
any help??
thanks
Last edited by peter_budo; Jun 28th, 2009 at 5:16 am. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
![]() |
Similar Threads
- make link from a variable. (PHP)
- dynamic array variable.. (PHP)
- Array with Variable Size in a Structure (C++)
- Can Array Name have Variable? (Perl)
- need to make a link (PHP)
Other Threads in the PHP Forum
- Previous Thread: PHP Thumbnail script - Generate thumbnails on the fly.
- Next Thread: display news from other news website
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess 301 access ajax apache api array beginner binary broken cakephp checkbox class cms code compression cron curl database date directory display download dropdown dynamic echo email error file files folder form forms function functions google href htaccess html httppost image include insert integration ip java javascript joomla limit link login loop mail md5 menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search secure select server sessions sms soap source space speed sql structure syntax system table tutorial update upload url validation validator variable video votedown web xml youtube






