Sponsored Content
Top Forums Web Development How to create a link that will display the contents of a PHP variable? Post 303012808 by crimso on Friday 9th of February 2018 12:24:17 PM
Old 02-09-2018
For clarity here's a larger chunk of the original script:
Code:
<?php
$hostname = shell_exec('hostname');
$manufacturer = `dmidecode -s system-manufacturer | tail -1`;
$model = `dmidecode -s system-product-name | tail -1`;
$product = `dmidecode | grep SKU | cut -d: -f2`;
$serialno = `dmidecode -s system-serial-number | tail -1`;
$iloipaddr = `ipmitool lan print | grep 'IP Address  ' | cut -d\: -f2 | sed 's/ //'`;
$sftwrlist = `rpm -qa | sort`;
?>

<p><b><u><big><?php echo $hostname;?></big></u></b><br/ >
<b>Manufacturer: </b><?php echo $manufacturer;?><br/ >
<b>Model: </b><?php echo $model;?><br/ >
<b>Serial Number: </b><?php echo $serialno;?><br/ >
<b>Product Number:</b><?php echo $product;?><br/ ><p/ >
<p><a href="http://<?php echo$iloipaddr;?>">ILO link: You must be on the same private subnet for this link to work.</a><p/ >
<b><u>Installed software</u></b>
<pre><?php echo print_r($sftwrlist);?></pre>

It's the last line I can't figure out. I've tried using href but it seems suited to point to another page which is why I created the separate script and changed the last line to:
Code:
<p><a href="sftwr.php">Installed Software</a><p/ >

Mainly because I have no idea how to put a line in the original script that will simply display the value of $sftwrlist. I'm pretty new to HTML and PHP and especially a rookie when it comes to mixing the two in the same script.
 

9 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

9. 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
VPDDECODE(8)						      System Manager's Manual						      VPDDECODE(8)

NAME
vpddecode - VPD structure decoder SYNOPSIS
vpddecode [OPTIONS] DESCRIPTION
vpddecode prints the "vital product data" information that can be found in almost all IBM and Lenovo computers. Available items are: o BIOS Build ID o Box Serial Number o Motherboard Serial Number o Machine Type/Model Some systems have these additional items: o BIOS Release Date o Default Flash Image File Name Note that these additional items are not documented by IBM, so this is guess work, and as such should not be blindly trusted. Feedback about the accuracy of these labels is welcome. OPTIONS
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) -s, --string KEYWORD Only display the value of the VPD string identified by KEYWORD. KEYWORD must be a keyword from the following list: bios-build-id, box-serial-number, motherboard-serial-number, machine-type-model, bios-release-date. Each keyword corresponds to an offset and a length within the VPD record. Not all strings may be defined on all VPD-enabled systems. If KEYWORD is not provided or not valid, a list of all valid keywords is printed and vpddecode exits with an error. This option cannot be used more than once. Mutually exclusive with --dump. -u, --dump Do not decode the VPD records, dump their contents as hexadecimal instead. Note that this is still a text output, no binary data will be thrown upon you. ASCII equivalent is displayed when possible. This option is mainly useful for debugging. Mutually exclu- sive with --string. -h, --help Display usage information and exit -V, --version Display the version and exit FILES
/dev/mem AUTHOR
Jean Delvare SEE ALSO
biosdecode(8), dmidecode(8), mem(4), ownership(8) dmidecode February 2007 VPDDECODE(8)
All times are GMT -4. The time now is 09:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy