👤
Home Man
Search
Today's Posts
Register

Discuss Web Programming and Web Server Administration, including LAMP, Apache, MySQL, HTML, SEO, and other Web APIs and topics.

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

👤 Login to reply

 
Thread Tools Search this Thread
# 8  
Old 02-09-2018
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  
Old 02-10-2018
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  
Old 02-12-2018
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 to reply

« Previous Thread | Next Thread »
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
awk to create variables to pass into a bash loop to create a download link cmccabe Shell Programming and Scripting 8 09-27-2016 12:51 PM
HTML: Display contents of file using Variable scott_cog UNIX for Dummies Questions & Answers 4 10-25-2013 12:34 PM
Cannot create a link with the same name w020637 UNIX for Advanced & Expert Users 2 09-12-2013 09:54 PM
Display array contents on a new line squrcles Shell Programming and Scripting 3 07-16-2013 11:56 AM
Folder contents getting appended as strings while redirecting file contents to a variable vivek d r Shell Programming and Scripting 2 03-29-2013 04:13 AM
What are the contents of a symbolic link? krishnampkkm UNIX for Dummies Questions & Answers 1 03-08-2010 08:15 AM
Display the contents of a table. gokulj Web Programming 3 10-06-2009 09:10 AM
Display the contents of an array RossMc UNIX for Dummies Questions & Answers 1 10-31-2008 01:25 PM
How to display contents of folder when 'cd' is used mumashankar UNIX for Dummies Questions & Answers 3 03-06-2008 06:42 PM


All times are GMT -4. The time now is 05:12 AM.

Unix & Linux Forums Content Copyrightę1993-2018. All Rights Reserved.
×
UNIX.COM Login
Username:
Password:  
Show Password