PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
vflflyer
Forum Newbie
Posts: 11 Joined: Wed Nov 16, 2011 9:41 am
Post
by vflflyer » Tue Nov 22, 2011 9:15 pm
I hope this makes sense! I am trying to hide an image (with css) so it does not print, when someone prints my form.
It seems to work if it is echoing text but once I change it to an image I have no luck. Here is the code
Code: Select all
<?php
if ($_POST["submit"] == "Calculate" && $emptyvar != 1){
$roiBar = "<img src='../images/results.gif'>";
}
?>
<div id="roiBar"><?php echo $roiBar ?></div>
Here is my print.css sheet
Code: Select all
@media print {
#roiBar{display:none;}
}
but it still shows
social_experiment
DevNet Master
Posts: 2793 Joined: Sun Feb 15, 2009 11:08 am
Location: .za
Post
by social_experiment » Wed Nov 23, 2011 12:35 am
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering
vflflyer
Forum Newbie
Posts: 11 Joined: Wed Nov 16, 2011 9:41 am
Post
by vflflyer » Thu Nov 24, 2011 12:27 pm
I really do not know php at all, so that link you you pointed me to does not help me.
Livengood
Forum Newbie
Posts: 11 Joined: Tue Nov 01, 2011 2:48 pm
Post
by Livengood » Thu Nov 24, 2011 2:11 pm
Code: Select all
<?php
if ($_POST["submit"] == "Calculate" && $emptyvar != 1){
$roiBar = "<img src='../images/results.gif' style='display:none;'>";
}
?>
<div id="roiBar"><?php echo $roiBar ?></div>
I see what your trying to do, why dont you actually put the css in the html.
Celauran
Moderator
Posts: 6427 Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada
Post
by Celauran » Thu Nov 24, 2011 2:21 pm
Livengood wrote: why dont you actually put the css in the html.
Because that's not where it belongs?
vflflyer
Forum Newbie
Posts: 11 Joined: Wed Nov 16, 2011 9:41 am
Post
by vflflyer » Thu Nov 24, 2011 2:24 pm
Livengood wrote: Code: Select all
<?php
if ($_POST["submit"] == "Calculate" && $emptyvar != 1){
$roiBar = "<img src='../images/results.gif' style='display:none;'>";
}
?>
<div id="roiBar"><?php echo $roiBar ?></div>
I see what your trying to do, why dont you actually put the css in the html.
I want this to hide when someone wants to print it not hide it on the screen