Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Removing Page Style


I found a great script which turns a HTML page into a PDF, but the problem is it turns the whole page, with layout etc, into the pdf, which looks really bad with all the navigation etc, on it. Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Wnat To Embed Full HTML Page In Email, But Migrating Style From Css Files To Element Style Attributes
My web pages of course use css files, but Webmail services require
style to be in element style attributes.

How do I convert a standard HTML page to HTML suitable for delivery to
webmail services?

Perhaps another way to ask the question is:

How to I walk the DOM and for every element, for every style, set the
element's style attribute to the values that are looked up in the css
file in normal rendering.

Anyone know of any tools, or examples to do this?

View Replies !
Reg Exp Question: Removing Class And Style From Html
i have a little database driven content managment system. people can
load up html-docs. some of them use ms word as their html-editor,
which resultes in loads of "class" and "style" attributes - like this:

<p class="MsoNormal">Some text</p>

now i'd like to remove them (the attributes, not the people, that is).
i know reg exp is the way, but somehow the solution avoids me.

View Replies !
Html Page - <style ... > Tag
If i have an html page and i am looking for the <style ... > tag. What would be the best way to look for it? I need to look for a special type, something like

<script language="Javascript" type="text/javascript" >....<script> .

View Replies !
Different Style/color In Header And Main Section Of A Page
I have a webpage with a header and main section. The header includes a small navigation bar. I would like the text and link color in the header be different from that in the main part. How can I do that?

View Replies !
Div Style
I have this line in my script

PHP Code:

<div style="width:310px; margin:24 0 0 2px">

What does each margin 0 stand for? I imagine its for spacing, but which is for which?

View Replies !
Same CSS Style In Php Segments.
I have several seperate individual php segment which make up my website. To
check what each segment actuallt displays I am linking my css style to each
and every segment in a wysiwyg program.

This results in a website with the same css file being called about 20
times. Of course I can delete all but one of these "link css rows" and then
add them again as and when a segment needs to be edited.

This seems to be a round about way of doing things even if it gets the job
done. Is there a more effective way?

View Replies !
Coding Style...
When i write a script, i tend to seperate the differnt functions with differnt files. For example. When i creat a user management script, i create and add_user.php file and a modify_user.php file, and so on. I also see a lot of people who simply write one big 10 meg php file that includes everything in one. (seperated into functions.)

Is there an advantage to this? Or is it just a matter of personal prefrence? I guess it really doesnt matter that much, i just wanted to know.

View Replies !
Perl Style In Php ?
Often I just want to be able to get at a single element from a
function that returns an array. For example, if I just want the
current year I need to write:

$today = getdate();
$year = $today['year'];

Call me lazy but this is two steps to return a single value.
In perl I can nest these two step together into something like:

$year = ( $getdate() )['year'];

I've tried to get several variations of this to work in php but I
don't seem to be having any luck.

Is this style possible in php?

View Replies !
Style Class Css Or PHP?
Having had a little experience of HTML and style classes but only a limited
knowledge of PHP perhaps somebody can tell me the pros and cons of the
following.

Surely if I write something in PHP like

$style = "<b><i><font size=&#391;'>"
$endstyle ="</b></i></font>"
$s = array($style,$endstyle)
echo $s[0] . "I want my font in bold italic and size 1" . $s[1]

does this not do the same as style classes? Taking it one step further, if I
write all of the styles in a script called styles.php and include it in all of
my php pages is that not the same as having a .css file?

Why use 2 programming languages when it can be done in 1?

View Replies !
Inline CSS Style
I'm having a problem sending email using php mail. The email is designed with tables so I'm using inline CSS styles. Problem is that the styles do not work. It gets displayed as text. Code:

View Replies !
CSS - Change The Style
how can I change the style of this code to align 10px to the right?

echo " <span class="leftfloat">$artist_name_next[$i] </span>"

I tried adding Style='left:10px;' but that didn't take.

View Replies !
Applying CSS Style
I am having trouble applying the style mytext (from CSS) to the following:

echo "Sizes Possible With ". "$size" ."mm Head Box, and ".$drive." Drive";

Any way I do it, I either get plain text, or the style being applied do the $size and $drive so they appear as that, and not as their values, or I get the correct text with no style applied, or I get a parsing error. The style works fine elsewhere in the script applied to a table. The problem seems to be mixing text and variables together.

View Replies !
Css Style Switcher
trying to make themed website. seenthis in one shop. and i want to do the same.
i came across the problem wich i cant solve. Code:

View Replies !
Using Style Position
I have two tables. If I leave them alone, one will print on the screen, then below it the next, etc. However, I want table one on the left and table two on the right of
the screen. Both are populated by two different queries, so they are not exactly created at the same time. I decided to use styles to position:absolute the second table to the
right of the first table.

I am worried that this is not correct. For example, my text size is set at smaller, but on medium the tables are not lined up right. The blend into each other and when the browser's text size is larger,
well, it looks terrible.

View Replies !
Adding Css Style
This is part of my code how do i put a style sheet on that I can't use the tr tag as I want my headings to be a different colour? usually I would put a class in the tr but I cant because of the php.

echo "<tr>";
echo    "<td>".$row['scan']."</td>";
echo    "<td>".$row['description']."</td>";
echo    "<td>".$row['serialpartno']."</td>";
echo    "<td>".$row['date']."</td>";
echo "</tr>";

View Replies !
Style Date
I was programming a calendar for a website and ran into this:

firstly:
mktime(0,0,0,3,27,2005); ->returns 1111878000
mktime(0,0,0,3,26,2005); ->returns 1111795200

and then:
date("d.m.y",1111878000); ->returns 26.03.2005
date("d.m.y",1111795200); ->returns 26.03.2005

Is this something one should except? Shouldn't the timestamps be
trusted or am I just confused?

View Replies !
CSS Style Output
I query mysql and output to a table:

I have a "text" style in my css style sheet. no matter what I have tried it will just not assign the style to the above.

View Replies !
Style Sheets
I have an external php stylesheet that is included in all my pages like this.

<link rel="stylesheet" type="text/css" href="style.php">

In the stylesheet the below is supposed to set the background color but the expression always evaluates false and I can't figure out.

body { background: <?php echo ($bkColor)?"$bkColor":"#003399"; ?> ; color:white; font-size:12pt; font-weight: bold.

View Replies !
CSS Style Switch
I am trying to create a mechanism which enables me to switch between a screen CSS (where every piece of content is shown) and a print css where images are not displayed. At the moment any new php pages I create are generated using a Dreamweaver template which has in it an editable region Code:

View Replies !
OOP Style Programme
I have just started OOP style programming and have made my first class. The class it self explanatory and simply takes an uploaded file and a name. As it goes through the verifyImage function, it will exit if there is an error. If no error then it carries on.
I have called it this way in my main page: PHP Code:

require_once('newImage.php');

$image = new newImage($_FILES['image']['size'], $_FILES['image']['type'], $_FILES['image']['tmp_name'], $_POST['name']);

if ($image->verifyImage()) {
    $image->moveImage();
}

View Replies !
Current Code To MVC-ish Style
I want to convert this current piece of code into a MVC-ish structure style of coding:
PHP Code:

View Replies !
Devshed Style Url's
As you know devshed is a php based site that stores the articles in mysql. For example the article in the following url is a dynamic article that is produced by php :

http://www.devshed.com/Server_Side/...ache/page4.html

The thing that I want to know is how this url can be dynamic ? The url isn't something like: article.php?section=administration&id=2344

I think this is done using the rewrite module of apache.. but how? If the site admins or any one who knows how to do this please reply my message..If there is an article/tutorial about this subject please let me know.

View Replies !
Optimization In Coding Style
I was wondering is there a point in optimization in code style... I
have used to put parenthesis around some php keywords, but they are not
needed.

For example, I always use:
echo( "String..." );
but I could use
echo "String...";

the same thing is with return:
return( $tempHTML );
as opposed to
return $tempHTML;

Also is there a point to variate between string delimiters " and ' ?
ie. is it better to use single quotes instead of double quotes if I
don't won't any variable in a string? For example:
'This is a string...'
as opposed to
"This is a string...".

Double quotes are needed, of course in other cases:
"Frankly my dear, your name is ${nameOfTheUser}!"

I know it sounds stupid, even hard to read, but what are your opinions?

View Replies !
Personal Bb Code Style
if i look at this form im filling out now they have the bbcode buttons, how do they work and how can i use this sort of idea for a for i have to out put certain variables eg:

if i am sending a email vaia my for and want all the first names to be included as a buton and last and the rest of there details, i think that this is VB code - is there a way to do it in PHP. also similer to the smilie faces it will replace it with the image when its submitted.

View Replies !
Formatting SQL Style Datetime
Is it possible to take a date in SQL form and format it with php?

2001-05-23 18:11:00 ---> processed --> 5/23/01 6:11pm

I won't be able to format when pulling from a database, or else this would be a lot simpler.

View Replies !
How Do I Get An Old Fashion C Style Array?
I am reading the php manual online and don't understand the way arrays work.
It says arrays take a key, value pair which is fine I guess, but how do I
get an old fashion c style array? Are the keys like the indices?
say I want an array that contains the numbers 0 through 10, what do I make
the keys or does it even matter?

View Replies !
Hotmail Style Php Script
I would like to include to my web application a msg service like hotmail but
database based and not real webmail, does anybody 've already developped a
service like that with all of the options hotmail include ?

View Replies !
Am I Too Wired? On Coding Style
I have a question that spining around my head for a long time. I
prefer to make this kind of if statement:

if (!$GLOBALS['phpgw_info']['user']['admin']) Header(
'Location: '.$GLOBALS['phpgw']->
link('/', 'menuaction=forum.uiforum.index')
);

But almost all the 'good' php code I saw write it this way:

if (!$GLOBALS['phpgw_info']['user']['admin'])
{
Header(
'Location: '.$GLOBALS['phpgw']->
link('/', 'menuaction=forum.uiforum.index')
);
}

the argument is the latter is more readable and easy to understand. But,
to me, a if statement immediately followed by another statement or
function call is more readable and easy to understand. It saved me from
thinking what's after this statement or function call. Truly, I think
keeping a stack of 'if' or 'for' in the brain is difficult for me, I
tends to remove the {} and add the statement after if-clause when if
statement contain only one statement.

I am just thinking if my way of keeping code logic in brain is too
wired. If most people truly consider the {} more easier to
read/understand, I'll force myself write understandable code; if there
are only very small difference in understanding (considering reading
10000 line of source, even small difficulty counts), I would like to
keep my style.

View Replies !
Ultima Style Rolegame With PHP...
its true now there is someone who wants
to add one of the best rolegames ever Ultima III
to his homepage...

Im very familiar with Visual C++ but not with PHP...

So, the question is how to...

What web sites i need to go thrue before i can
achive my goal a PHP Ultima III style rolegame
and is PHP compelitely wrong language to use ?

Java applet maybe ? I hav MS Visual Java...

View Replies !
Remove Style Tags
I have tried this:

<?php preg_replace("~<style(.*)>(.*)</style>~"," ",$getvid); ?>

It doesn't work, all I want to do is remove the style tags, and everything between them. In there place I want to insert a space.

View Replies !
Ip Address And Adding Style In Php ?
1. how do i get the ip address of the user visiting a page ?

2. echo "<span><pre>  $row[0]      $row[3]    This link worked for $row[1] out of $total people.  DID THIS LINK WORK FOR YOU ? <a href='worked.php'>YES</a>      <a href='notworked.php'>NO</a> </pre> </span>";
echo "<br>";

i want the output above display text with gray background color...how ?

View Replies !
Mod_rewrite Style Urls On IIS
I'm interested in using PHP to do a simple mod_rewrite function on IIS, my site is on a shared server, so I don't have access to the administrator side of things, so I was wondering if I could use a php script as an intermediary, instead of using '?' as the delimiter for a query string, you pass a string like:

www.sitename.com/obj.php/section/id/10/

obj.php would work out what exactly you're trying to do, and to a search engine I'm assuming that it'll look like a directory as opposed to a script? I'm sure it's easy to do, it's just the search engine implications of doing it I'm interested in.

View Replies !
Implement A Style Switcher Using Php
just trying to implement a style switcher using php. but because i explicitly tell the browser to cache my pages, even though i header() back from the style_switcher.php to the referring page, the old style is still in place. the cookie with the new style is set correctly, but until i manually force a refresh, the new style can not be seen.

View Replies !
Style Text In The $mailbody Tag
I've been trying to figure out how to style some contents in the $mailbody tag, but I cannot figure out the proper usage. It would be helpful to know this so I can apply any sort of styles, including font sizes and such.

View Replies !
Getelementbyid Style Doesn't Work In IE
i have an image with assigned id="loading" when i select the menu from select menu, the image is getting visible when the operation is done, the image doesn't get invisible
in firefox it does, but in IE it doesn't any suggestion please?

View Replies !
DBMaker Style RegExp
I dont know if anyone has come across DBMaker (internet-soft.com) before but it would be really handy to 'ape' the way it can extract data, i.e. by using a start and end delimeter and anything in between gets extracted in to a variable. Would anyone know of a way to do this with regexp?

View Replies !
Serving Different Style Sheets
I have two different style sheets, I would like all IE users to receive style1.css, while everyone else receives style2.css. I don't need a different one for each browser, just one for IE and one for everyone else.

View Replies !
For Loop Works In Js Style
I've been learning some JS lately, and some coding styles are mixing around. Is there anything wrong with doing:

for($x=0;@$config[$x];$x++) {

}

in php?

View Replies !
Encode Tinyurl-style
I have a several numbers (1282 or 2845) which I want to encode "tinyurl"-code-style (gd2h or s9d5), because a big number could be displayed with a few letters. My idea:

I use an array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',&#390;',&#391;',&#392;',&#393;',&#394;',&#395;',&#396;',&#397;',&#398;',&#399;') which contains all the letters and digits I want to use in my code.

My encoded numbers should look like this:

1 becomes a, 2 becomes b, 3 becomes c, ... , 36 becomes 9, 37 becomes aa, 38 becomes ab, 39 becomes ac.

I have no idea how to calculate it without a big loop. That of course would slow down the script a lot. perhaps you have an idea.

View Replies !
Style Sheet Not Working
I have this code hear, and the CSS file path is correct, but it dosent seem to want to display.. Code:

View Replies !
Retrieving Style Info With 5 DOM
I have a situation where I need to determine the width and height of Youtube & Google videos from their embed codes. Ideally I'd like this to be future-proof, so, I think the best way to do this in PHP is using DOM functions.

That way if the embed code changes at some point in the future the script will still work.

Youtube & Google Video set their width & height attributes differently: Youtube sets, 'width="somewidth" height="someheight"' whereas Google Video uses the style attribute: style="width: somewidth; height: someheight;"

If I was using javascript this would be relatively straightforward, however in PHP I haven't found a way.

Does anyone out there know how to do this? Note: I'm using PHP 5.1.4, so I'm using the new PHP DOM system.

View Replies !
Changing Style Sheet
i need help to deal with stylesheet. is it possible to pass the stylesheet as an orgument to the document using php. and how can i use the dynamic style sheet instead of using the existing stylesheet without deleting that.

View Replies !
Wiki Style Linking
I am looking for a way to implement the "wiki" way of internal linking. What I mean by this is is that I simply wrap [[]] around the page I want to link to, i.e [[Water]] and it creates a link. I am currently struggling to do this though and wondered if anyone can help, I suspect it should be fairly simple.

View Replies !
Changing The Font Style
im working on a line of code that will let the user customize there post and i want to let them change the font style and color i have the color part working but i cant get the style to work im new at this so i need help and my stupid little brother dosent know lol PHP Code:

<font face=<?php echo $fontstyle ?>><font color=<?php echo $fontcolor ?>> <?php echo $discription ?></font>

View Replies !
Wiki-Style Highlights
I've been boggled over how do do this efficently for almost a week now; How would you compare and highlight the differences between two large paragraphs efficently; Similar to the way you can view the differences in a Wiki article after it's edited.

http://en.wikipedia.org/w/index.php?title=PHP&diff=59815132&oldid=59809982

View Replies !
Setcookie For CSS Style Sheet
I am trying to implement a change into my site without the use of javascript that allows the user to click a link which will change the stylesheet for the entire site, but it is not working and I need help in finding out why!

Here is my PHP script that creates a cookie. I call this script via a simple hyperlink on my web page. Code:

View Replies !
Style PHP MySQL Output
at the bottom is code that displays users information on the page, but not in a nice CSS way.

<?php
if(isset($_POST['name']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$web=$_POST['web'];
$comment=$_POST['comment'];
mysql_connect("blah", "blah", "blah") or die(mysql_error());
mysql_select_db("blah") or die(mysql_error());
mysql_query("INSERT INTO blah(`name`,`email`,`web` , `comment` ) VALUES
('$name', '$email', '$web' , '$comment')") or die(mysql_error());
Print "Your information has been successfully added to the database.";}
...

View Replies !
Style Sheet Switching
I would like to write a script that will determine which browser/platform a user is on and then select the proper style sheet. I've done this before only to select either a style sheet for IEWin or the default style sheet. This is the code I used:

<?php
$useragent = (isset($_SERVER["HTTP_USER_AGENT"]) )?
$_SERVER["HTTP_USER_AGENT"] : $HTTP_USER_AGENT;

if (strpos($useragent, 'MSIE')) {
$css_file = '/style_ie.css'
} else {
$css_file = '/style.css'
}
?>

But now I want to be able to determine the difference not only between IE and other browsers but also Mac and PC. The above script will only recognize a single word as the string.

View Replies !
Looking For GOOD Style Code Samples
Looking for GOOD code samples to learn good php style from. I'm talking about well structured code that tries to separate html / general PHP / database code.

It would make use of of modules/classes/libraries (whatever you call the method to encapsulate clean reusable functionality in PHP.

Also, any recommendation for good and fast pace PHP intro to in depth tutorial.
I don't need baby talk, just something clean and focused so I can be coding (clean code) really soon.


View Replies !
Wiki Style Text Input
I have a text file called test.txt which is I am trying to get to load
into a webpage. This is simple enough, but I am trying to make it so
that it recognises certain formatting, similar to how wikipedia pages
work.

so, my text file contains ONLY the following:

This is /just/ some test text *to see* if the PHP works
and to /*evaluate*/ what it actually does

The intention is that /just/ will show as italic, *to see* will show as
bold and /*evaluate*/ will show as bold italic.

Creating the text inside the page works fine.

<?php
$s = 'hello. /this/ works *bolding* works. /*Both work*/!'
$search = array ( '@/(.*?)/@si',
'@*(.*?)*@si');
$replace = array ( '<i>1</i>',
'<b>1</b>');
echo preg_replace($search, $replace, $s);
?>

However when I try and read from a text file using

$s = file('./wiki.txt');
$search = array ( '@/(.*?)/@si',
'@*(.*?)*@si');
$replace = array ( '<i>1</i>',
'<b>1</b>');
echo preg_replace($search, $replace, $s);
?>

All that is shown is the single word 'Array'. This confuses me a lot as

<?
$s = file('./test.txt');
print_r($s);
?>

shows that the text is being read into the page
Array ( [0] => This is /just/ some test text *to see* if the PHP works
[1] => and to /*evaluate*/ what it actually does )

View Replies !
A Crazy PHP, CSS, JS Error In Style Switching...
I've been doing A LOT of work on my site over the past few days as I've REALLY broken in to PHP (with the very fine help of the folks here at WW).

My site uses themes that were applied on links when you enter the site by using onmousedown and the hyperlinks and then in order to ensure the user still got in to the site onmouseup would change the url location.

However this presented a roadblock to IE users to which I had to add a big red box explaining how you had to slowly lift your mousebutton back up after waiting a second after pressing it. High-tech $h!t for IE users and one guy who tried to trash me in my own guestbook even IoI...

So I needed a better way to apply the themes to my site and remove the hidden JS intended to give a message only for IE users who of course are effected by that method. After I added the message coincidentally my rank in google again plumeted from page 3 to page 11 (go figure).

Coincidentally I had learned how to set cookies with PHP just a few days earlier. Now my site sets cookies based on which frameset file is loaded. So I evnetually got the idea that I could have PHP detect the bandwidth setting (bandwidth and audio settings are saved by the cookie when the user enters the site by choosing their preferences) by looking at the cookie.

Well it worked...kinda. Once you enter my site and wander to the Themes page if you try to use a theme intended for the opposite bandwidth (dialup/broadband) some wacky stuff happens...

If you enter the site via dialup everything works fine with the themes. However if you choose broadband you start to notice stuff.

For example the dialup versions of the stylesheets are W3 compliant versus the broadband versions include cursor and scrollbar enchancements for IE. These will be applied if you use broadband on IE and choose a dialup version of a theme.

You'll also notice the icons are loaded when you choose dialup though they should NOT load from dialup stylesheets ever.

There is also a matrix background image for the broadband theme (that I've grown to hate thanks to crappier comps then mine but haven't yet removed) that only loads when you DO choose the broadband version of the Matrix theme. So a contradiction to a contradiction?

This leads me to believe that somehow ONLY when you choose broadband do the themes get mixed up. Yet if you choose the matrix dialup theme the background image does not load.

Now the only guess I have is that since the dialup themes are intended to be as slim as possible to make the site load much quicker the classes for the icons are being overwritten by the broadband stylesheets since the PHP writes the default stylesheet if you choose broadband.

That would be because (I think) if you have two stylesheets and one class is better defined on sheet B then sheet A even IF you're trying to use JUST sheet A it will still load stuff based on B. Thats my current theory of whats happening. But if I add the classes I will negate an additional 2 seconds of load time for dialup users who think they have broadband ... ahh aol users I mean.

View Replies !
PHP Style Switcher - Browser Problems
I posted about this a few days ago, and I got a few suggestions that
fixed part of my problem.

I am using a PHP script to switch external style sheets when the viewer
clicks on the style link. Search "Amanda H." in this group and you can
view my last post to see the original PHP and html junk. This below is
the updated link rel and the meta tags.

Before, it wouldn't refresh or change in Opera, Firefox, or IE6/Win &
IE5/Mac. The bits added on to the link rel and adding the meta tags
worked for Firefox and Opera.

In IE6/Win, the style sheet loads, but a manual refresh makes it
actually load. In IE5/Mac, the style sheets won't switch at all. I
don't know PHP very well, so I don't know what the problem could be.
Here's the script and code:
-------------------------

<?
header('Content-Type: text/css');
// CONFIGURATION
// If you want to specify a default CSS file for users who can't handle
// cookies, replace styles.css with the filename below:
$basicsheet = "basic.css";
// CHECK IF NEW STYLESHEET IS BEING LOADED
if(isset($_GET['sheet']) OR isset($_POST['sheet'])) {
// CHECK IF FILE IS SPECIFIED IN URL
if(isset($_GET['sheet'])) { $newsheet = $_GET['sheet']; }
// CHECK IF FILE IS SPECIFIED IN FORM DATA
if(isset($_POST['sheet'])) { $newsheet = $_POST['sheet']; }
// MAKE THE USER REMEMBER WHICH STYLESHEET IS LOADED
setcookie("my_stylesheet", "$newsheet.css", 0, "/");
// SEND THE USER BACK
$ref = $_SERVER['HTTP_REFERER'];
header("Location: $ref");
} else {
// NORMAL STYLESHEET REQUEST
$mysheet = $_COOKIE['my_stylesheet'];
if($mysheet == "") { $mysheet = $basicsheet; }
include "$mysheet";
}
?>
-----------------------------------------
Then the new link header & meta tags for the HTML file:

<link rel="stylesheet" type="text/css"
href="http://www.amandahenson.com/styleswitcher.php?<?php echo time();
?>" />

and

<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="pragma" content="no-cache" />

It works in most browsers, but it still has those problems with the browsers mentioned above.

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved