How to create a link that will display the contents of a PHP variable?


 
Thread Tools Search this Thread
Top Forums Web Development How to create a link that will display the contents of a PHP variable?
Prev   Next
# 1  
Old 02-08-2018
How to create a link that will display the contents of a PHP variable?

Greetings,

I've wrote a script that when you point your browser to a machine it displays info about itself. Below is a small snippet of the script:

Code:
<?php
$iloipaddr = `ipmitool lan print | grep 'IP Address  ' | cut -d\: -f2 | sed 's/ //'`;
$sftwrlist = `rpm -qa | sort`;
?>

<p><a href="http://<?php echo$iloipaddr;?>">ILO link: You must be on the same private subnet for this link to work.</a><p/ >

What I've been trying to figure out is how to create a link on the resulting page that will display the $sftwrlist variable contents. I've tried various combinations of href but I'm not sure at this point it's the correct way to accomplish my goal. Any suggestions or hints would be appreciated.

---------- Post updated 02-08-18 at 08:56 AM ---------- Previous update was 02-07-18 at 10:54 AM ----------

Unable to figure out how to get that link in the original PHP script I opted to create the $sftwrlist in a separate PHP script and link to it from my original script. New software list script:
Code:
<?php
$sftwrlist = `rpm -qa | sort`;
?>

<b><u>Installed software</u></b>
<pre><?php echo print_r($sftwrlist);?></pre>

Line in the original to get the list:
Code:
<p><a href="sftwr.php">Installed Software</a><p/ >

Not the way i wanted to do it as it would have been nice to keep my goal to a single PHP script but this will have to do.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk to create variables to pass into a bash loop to create a download link

I have created one file that contains all the necessary info in it to create a download link. In each of the lines /results/analysis/output/Home/Auto_user_S5-00580-6-Medexome_67_032/plugin_out/FileExporter_out.67... (8 Replies)
Discussion started by: cmccabe
8 Replies

2. UNIX for Dummies Questions & Answers

HTML: Display contents of file using Variable

<tr><td bgcolor=#D7EBAD><b>Instructions :</b></td> <td>`cat temp.txt`</td></tr> Hi Experts, I have an requirement of displaying file contents in HTML mail , for which am using the above approach, Where as the output is kind of not as expected. If there are 5 lines in the file, in the... (4 Replies)
Discussion started by: scott_cog
4 Replies

3. UNIX for Advanced & Expert Users

Cannot create a link with the same name

Hi - Our system admin cannot create a link to NAS with one particular name but he can create with other names. What might be the cause? Regards ---------- Post updated at 11:30 AM ---------- Previous update was at 11:29 AM ---------- It says permission denied. (2 Replies)
Discussion started by: w020637
2 Replies

4. Shell Programming and Scripting

Display array contents on a new line

ksh eg arrayname=(1 2 3 4 5) I'm trying to display the individual contents of an array on a new line without using a loop, using one line of code. output 1 2 3 4 5 (3 Replies)
Discussion started by: squrcles
3 Replies

5. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

6. UNIX for Dummies Questions & Answers

What are the contents of a symbolic link?

Hiii... I wanna know "What are the contents of a symbolic link?"....... From google I dint get a good answer....that's why I posts here...... Thanking you. Krishna (1 Reply)
Discussion started by: krishnampkkm
1 Replies

7. Web Development

Display the contents of a table.

Dear Friends, Am an newbie to this domain. I have a table which is filled with contents which i need to be updated with,so am trying to design a flow which would read the data from the table and mail it to me at regular intervals. I could make out the flow using mailx command but want to... (3 Replies)
Discussion started by: gokulj
3 Replies

8. UNIX for Dummies Questions & Answers

Display the contents of an array

Hi i have just registered So i am at university studying forensic computing and we have to learn c++ i have never done anything with c++ before and i am abit stuck i need to create a programme to display the contents of an array of characters forwards and in reverse Can anyone help me... (1 Reply)
Discussion started by: RossMc
1 Replies

9. UNIX for Dummies Questions & Answers

How to display contents of folder when 'cd' is used

Hi, I am a new learner of Unix. I am currently working on a Solaris 8 machine. Earlier, when I use 'cd <folder name>' command, I am not only able to change the folder but also able to see the contents of the folder as if a 'ls -lt' command was executed. However, since a week, suddenly this... (3 Replies)
Discussion started by: mumashankar
3 Replies
Login or Register to Ask a Question