Programming :: Put All The HTML In A Print Statement?
Sep 14, 2010
I have a site which will have, for example, a login system where people have to enter their usernames and passwords, depending on which they'll be let in to the site. So, in code, I've got a line like:
if ($_POST['password'] == $password) {
then do whatever
}
else { print "Wrong password" ; )
My problem is, this "Wrong password" printing is just a solitary line, not keeping with the colours and style of the site, and it looks very bad. I want to ideally, output some HTML, which will have a picture, and print the "Wrong password" in the font and colours I desire. Do I have to put all the HTML in a print statement, and then deal with the nightmare of escaping all the quote marks in it with a ""? Or is there a cleaner method to the whole thing? Maybe something like this -
if ($_POST['password'] == $password) {
then do whatever
}
[code]....
View 4 Replies
ADVERTISEMENT
May 13, 2009
I'm trying to write a script that will spider a particular webpage that shows the current inventory for their products. I need to figure out the optimal method of parsing the web page, and extracting the <td> line for the "qty" for "Product 2":
Code:
<table border="0" width="100%" cellspacing="1" cellpadding="3">
<tr>
<td align="left" style="background-color: #EAEAFF; border-bottom-style: solid; border-bottom-width: 1" nowrap width="20%" height="50">
<p align="left"><font face="Arial" size="2"><b> Evaluation
[code[.....
View 4 Replies
View Related
Feb 7, 2011
I have a problem with arrays in awk. What i want is to take some data from a file (ssh log) and print it to a html table. I have managed to print some stuff (user logged in and how many times they have logged in) What i want more is to take all the ip that each user logged in from and print it in a row next to the username and times (in the code i typed blabbla where i want the ip to be shown. How do you think i should approch that, multidimensional arrys maybe?
Code:
View 14 Replies
View Related
Jun 28, 2010
We are building our C++ project in Kdevelop IDE. Every time we run "Run Configure" from the "Build" menu, a file named "libtool" gets automatically generated. This file contains a statement as "ECHO="echo"".f we run "Automake", without modifying the "libtool" the system hangs and theputer needs to be restarted.Therefore every time we run "Run Configure" we need to include the line "echo="echo"" below the statement "ECHO="echo"" manually.I think a script can be written which does the above on its own.I am not a shell script programmer, I know the good tutorials for shell scripts are available on the net, but learning scripting only for this task would be time-consuming and painful.
View 4 Replies
View Related
Oct 6, 2010
I've written a simple perl code to learn switches in perl.My code is pasted below,
#!/usr/bin/perl
$opt = 1;
switch($opt) {
[code]...
View 3 Replies
View Related
Sep 12, 2009
what is the best way (i.e standard way that is supported on all browsers and probably as well followed by web crawlers).... to include an html file either locally or externally in another ? Of course , i've done the research and i also know that there are server side includes (php , asp ...you name it) at the moment , i'm using this:
Quote:
<script type="text/javascript" src="path to file/include-file.js"> </script>
however, i've been warned that this method may not show up in some browsers as some tend to ignore this tag and that crawlers like your favorite search engine wouldn't bother reading this. so , what is the best and safest way to do the job? and btw , the reason why i've ousted SSI's from the start is because of among other things:
1) the fact that the included file is static html and because the text is included pretty much everywhere
2) hoping to reduce load time as the code (if successfully recognized) would hopefully be treated like any other embedded external file (e.x like an image) , therefore it would be cached without the need to downloaded it over and over again for each new page on the site.
View 1 Replies
View Related
Dec 3, 2010
I cant print html files using linux mandriva (Foomatic)
View 5 Replies
View Related
Jan 11, 2010
Ubuntu 8.0.4,GnomeDesktop with firefox (we are going to use) Epson Thermal printer(M-T500 Thermal Printer) [URL]... without linux driver,provide serial port ctrl. I get the command manual(pfd).I can test the command by run minicom however. I want to print the Web page (.html) provide by our web servers.Those pages have a js-button(javascript) each with the function that the firefox/or (custom) app demo is called to print the line/table/div/etc (not the whole page,like the receipt) after the js-button is pressed. There is a window showing the print-progress info will be better when it is printting. I just try to find the best way to do this: I got ghostscript after search by google but it is just used for pfd print or something. So How can I just implment this?
View 1 Replies
View Related
Sep 27, 2010
When I print receipts from certain company's emails, they span three pages or more bloated with images, links and overly large text. I can view the message in plain text by setting the preferences to only display text instead of html, but it doesn't affect what is printed. I still get the full HTML page printed. Is there a way to force evolution to print in plain text instead of HTML?
View 3 Replies
View Related
Jul 9, 2010
I am trying to create a script to be used on RHEL server. If I replace the $t with a number, the script works. If I try add a variable or the $1, the script doesn?t work (returns all processes even if less than the $t value). I thought that it may be treating it as a literal, but I wasn?t sure of the conversion.
t=$1
echo $t
lcnt=`ps -eo pid,ppid,rss,vsize,pcpu,pmem,cmd -ww --sort=pid | awk '{if ($6 > $t) print
[code]...
View 2 Replies
View Related
Aug 12, 2009
When you use an if statement directly in bash you have to put the ";" at the end or not? or am I mixing it with the for loop? I am reading advance bash scripting and it shows the if - then statements without ";" so I need a little clarification here.
View 2 Replies
View Related
Sep 21, 2010
I'm trying to code a sql statement for use in a PHP script.I'm looking to find the number of matching records in two tables and display them.How would you write that statement.I've tried using count a few ways, but no cigar.
View 2 Replies
View Related
Jun 9, 2010
the following works and BASH doesn't complain, but VIM highlights the closing square bracket is if it sees a syntax error. Is there a better way to express regex in a case statement or is this an issue with VIM?
Code:
#!/bin/bash
case $1 in
[code]...
View 3 Replies
View Related
Jan 23, 2010
Does it possible to escape * in the case statement
Code:
View 2 Replies
View Related
Jun 7, 2010
The script that Iam trying to write is running a for loop and reading line by line from a text file. inside this for loop i would like to execute update SQL statement .
a pesudo code is
Quote:
`$ISQL -U $username -P $Password -D $Dbname -I $INTERFACE <<QRY
for id in $idlist #idlist iam reading from a file
[code]...
View 8 Replies
View Related
Jan 29, 2011
It is under PHP/MySQL
$queryresult = $conn->query("INSERT INTO normalrequests VALUES($finalkey, 1234, 5678, FALSE)");
It is connected to the database successfully but I feel there is something wrong with the statement up there.
View 6 Replies
View Related
Oct 6, 2010
This script that I found online does the job it promises. it does convert the files to mp3 without an issue. What I need to include now is an if statement that says If $file.mp3 exists then delete $file.wav
Code:
#!/bin/sh
# name of this script: wav2mp3.sh
# wav to mp3
# Credit to the script creator (Nikesh Jauhari):
[Code]...
After that I'm stumped as to how to do the if statement
View 14 Replies
View Related
Aug 7, 2010
I've started dabbling with the case statement in order to pass some option's arguments into variables. I do not think I am doing this right.
Code:
usage() {
echo "Usage: $0 [-z|--snooze] [-c|--channel] [-p|--playlist]
[-m|--message] [-v|--mpcvolume]"
[code]....
As you can see, I want to pass arguments depending on the option(s) chosen by the user; ie. --snooze, or --channel. By default, if no options are chosen, I'll display a usage message; though in the future I'll provide some sane defaults. I'd like to create a case statement to handle passing arguments to any number of options; something like:
Code:
wakethehellup.sh --snooze 20 --message 'wake up!'
and for the other arguments, it would have a default set. The case statement I provided fails with a syntax error "syntax error near unexpected token `$2'" near the '--snooze' in the statement, so I take it you can't pass a parameter in this way; but I'm confused as to how I'm supposed to pass different parameters to different options without the options being confused as parameters.
View 2 Replies
View Related
Apr 8, 2011
I want to match for this string:
Code:
Content-Transfer-Encoding:[:space:]base64
Content-Disposition:[:space:]attachment;[:space:]filename="%variable%"
Both lines are new lines, so they won't be inline. Other than that, they are all constants, I want this regex match to be an if statement rather than returning match string. so if the $content variable contains some string that matches:
Code:
if `sed "//p"` ;
View 4 Replies
View Related
Feb 3, 2010
How do i make my strings case-insensitive while comparing them with an if statement?
View 2 Replies
View Related
Nov 12, 2010
This is what I have
Code:
When I run the program it will print
Quote:
rather than
Quote:
And completely ignore the kbd.nextLine statement.
However, when I write next instead of nextLine, it works.
View 3 Replies
View Related
Feb 16, 2011
A question of ODBC correctness - maybe someone knows.
Code:
// statement handle is sth, connection handle is dbch
SQLExecDirect(sth, ...);
// ... bind var, fetch results ...
SQLFreeHandle(SQL_HANDLE_STMT, sth); // free statement handle
SQLEndTran(SQLHANDLE_DBC, dbch, SQL_COMMIT);
(error checking removed for clarity).
To my mind this seems wrong - surely the statement handle should be free'd only after the commit is done? Or maybe not. I theorize about the ODBC library like this: a whole set of statements can be created, run, executed in one transaction (which is held at the connection level), and only after all that is a commit/rollback done. So maybe it's OK. Even so it still feels weird. What is written above works, but there are rare and very difficult to replicate problems with this code, and I wonder if a premature free might be the cause...?
View 2 Replies
View Related
Jun 29, 2010
how do I get this regular expression to work in an if/else statement? This is just a little script for learning BASH. don't be too harsh.
This script will test if a certain number of files with 1-4 in their filename exist and print their filename. An error message will be printed if not.
#
for i in `ls file[1-9]`
do
if [[ "$i" == *1-4 ]] ; then
echo "This file, $i, ends in a number between 1-4"
else
echo "Error, this file, $i, does not end with a number between 1-4"
fi
done
I get this error. ./file_test.sh: 13: [[: not found
View 2 Replies
View Related
Feb 15, 2011
At the moment I got my md5sum checking working which I write to a text file and see below.
If the md5sum works it will write the output to check2.md5 test.txt: OK
If the md5sum fails it will write test.txt: FAILED
How do I write if statement to check the output whether or not the md5sum failed or not ?
check1="/home/ops/Desktop/test1/check1.md5"
check2="/home/ops/Desktop/test1/check2.md5"
cd /home/ops/Desktop/test1
md5sum test.txt > $check1
[Code]....
View 2 Replies
View Related
Jul 30, 2010
adf 32 324 100 100 24 234I want a gawk statement to match the above line if lets sayand field between 4 and 6 == 100.
View 2 Replies
View Related
Feb 3, 2010
I was doing an exercise on Learning Perl, 3rd edition. (exercise chapter 10 btw) The problem asks to create a program that generates a random number and asks the user to guess. It should tell the user if the guess is lower or higher and exit if the user types either exit or quit. My code is the following:
Code:
#! /usr/bin/perl
$correct = int(1+rand 100);
[code]....
View 2 Replies
View Related
Apr 29, 2010
I have to enhance the behaviour of a backup script written in perl. I don't need to change it, what I need to do is to create a bash script that does some checks like file name and file size, execute the backup script then check if the backup files match the original files.Here's how I try to do it:
- read the files from the original files folder
- store them in an array
- search in the array the files that have a specific file extension
- store the file names that match the search pattern (I know the backup script skips some files so I can hardcode the search pattern)
- run the backup script
- read the files from the backup folder
- store them in an array
- compare the original files name and size stored in an array with those from the backup folder
- send a report email
View 3 Replies
View Related
Sep 21, 2010
In my site, I have a "Make A Friend" link, which will lead to a page where the user has to input their username and password, to identify who they are. The link is like so: "makeafriendlogin.php?person=26", to identify the person who is going to *making* the friend. When the Submit button on the login page is clicked, the "person" argument has to be transmitted to the script that handles it (makefriend.php). This is how I'm going to lay out the "makeafriendlogin.php" script:
<form method="post" action="makefriend.php">
<input name="username" type="text>
<input name="password" type="password">
<?php
[code]....
My probem is with the "<input name="author" type="hidden" value="$author">" line - unless I put it within <?php and ?> tags, the "$person" won't be parsed, but at the same time, it's HTML, not PHP.... so I can't figure out what to do. Should I put it in a "print" statement?
View 1 Replies
View Related
Dec 4, 2010
I am currently following the instructions from the Linux From Scratch book and have made it to the downloading of the patches.There are links to all of the needed patches but when you click them, instead of downloading a file like I expected, it takes you to an html page displaying (I'm guessing) some sort of programming or scripting language. Link to the page with the all the patch download links. From there instead of downloading the file it displays its contents.
- www
- (period)linuxfromscratch
- (period)org
- /lfs/view/stable/chapter03/patches
- (period)html
(had to break it up because the forum won't allow me to post links yet ) My question is: What do I need to do with this text? Do I copy and paste it into a text file? Are there certain extensions that I need to append to the text files?
View 3 Replies
View Related
Jan 1, 2011
Im new to linux Iam pursuing bachelors in computer science engineering.... my final year project is to develop a "html to pdf converter using linux"... i have some basic knowledge of commands used in unix
1) Where can i get the basic idea about the existing converters... their pros and cons...
.... programming...
2) Any kind of material or source where i can get basic idea of programming used for converting html pages that are linked into a single pdf..
View 1 Replies
View Related