Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
can i ask you guys something. is this code can be run through webpage?
i want serial file to be auto generate when user run the webpage and not with sh code.
Code:
dmidecode | grep Number > /var/www/cgi-bin/serial
i have tried by putting sh example.sh code inside example.sh file but it doesnt work.
can someone tell me on how to auto generate serial file through webpage if this code is wrong.
err.. is it hard to understand or this question just to hard??
emmm..
what i want is, when i run this example.sh script through website and it will auto create a another file called serial. inside that file contain serial number. that all.
errr...
i want to display my serial number using web browser. i have my php code that will ask user to put some name like example. and that name will be shown with serial number like this.
enter name:______
name : athrin.
serial: xxxxxx
the problem is the serial wont show. i already tried to do this code
Code:
dmidecode | grep Number > /var/www/cgi-bin/serial
by sending the serial to another file and in my bash will call the file by using "cat". but it still not showing, i want my serial to be shown. do you have any idea on how to do that?
you cannot run dmidecode by browser it will say permission denied .. If u already saved your serial number in a file u can always display it through webpage ..PHP can do it..The following code will work
Quote:
echo `cat /var/www/cgi-bin/serial`;
In the above quote note that to make your linux command work you have to use above command...
u can show your linux command in web-browser by
SO you want the output of a bash command to appear inside an HTML page?
How are you executing the command? Seems like doing it via PHP would be the only way.
No almost every server side scripting language has inbuilt functions to make system calls..
PHP has two or three methods to do that ,one of them is above ...
I know that PHP isn't the only scripting language that can do it, I just said it that way since PHP was what the OP is using. I'll edit my post to clear up the confusion.
you cannot run dmidecode by browser it will say permission denied .. If u already saved your serial number in a file u can always display it through webpage ..PHP can do it..The following code will work
In the above quote note that to make your linux command work you have to use above command...
u can show your linux command in web-browser by
hope this works for you
i know it will work but only work with serial, name will not be display
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.