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


Login or Register to Reply

 
Thread Tools Search this Thread
# 8  
Quote:
Originally Posted by crimso
Correct, I could but this a PHP script that is in the machine's /var/www/html directory that you point your browser at.
Yes, it is; I'm not sure how this prevents you from printing something.

Your PHP script - and most other CGI scripts like it - don't interact with a web browser in real-time, it runs once on page load then quits. Your program has already quit by the time someone is looking at its output, and clicking would either cause another page load (of the same script or a different one), or trigger something to happen in the page's HTML, or execute a javascript program.

The simplest way would be to use HTML expanding sections, like this:

Code:
<details>
    <summary>Clickable Part</summary>
    Hidden Part
</details>

# 9  
Well thanks for that! Finally it makes sense why I've not been able to do what I thought I should be able to do. So creating the link that launches another script that runs the rpm makes the most sense to get what I want. On the front end it doesn't look any different than what I wanted it just means I need the href line in the original script and the script it calls. Thank-you kindly @Corona688 for chiming in.
# 10  
Quote:
Originally Posted by crimso
Well thanks for that! Finally it makes sense why I've not been able to do what I thought I should be able to do. So creating the link that launches another script that runs the rpm makes the most sense to get what I want. On the front end it doesn't look any different than what I wanted it just means I need the href line in the original script and the script it calls. Thank-you kindly @Corona688 for chiming in.
You could also do so using the same script, doing different things when called with different parameters. See http://path/to/script.php?value1=a&value2=b, the $_GET superglobal, and array_key_exists($_GET,"key"
);
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
awk to create variables to pass into a bash loop to create a download link
cmccabe
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...... Shell Programming and Scripting
8
Shell Programming and Scripting
HTML: Display contents of file using Variable
scott_cog
<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...... UNIX for Dummies Questions & Answers
4
UNIX for Dummies Questions & Answers
Folder contents getting appended as strings while redirecting file contents to a variable
vivek d r
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> ...... Shell Programming and Scripting
2
Shell Programming and Scripting
What are the contents of a symbolic link?
krishnampkkm
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... UNIX for Dummies Questions & Answers
1
UNIX for Dummies Questions & Answers