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.





Selective Rendering Of Part Of A Page


I want to skip the rendering of certain parts of a Web page if the
user doesn't have a certain permission (e.g. a cookie). I'd like to do
it along these lines:

<p>Anybody can see this paragraph.</p>
<? start_protected_section($got_permission); ?>
<p>Not everybody can see this paragraph.</p>
<? end_protected_section(); ?>

Is it possible to disable the rendering of a section outside the code
like this (perhaps by setting a PHP flag to redirect subsequent
output)? I don't really want to complicate things by moving part of
the page into a separate "include file" or mixing the HTML and PHP by
using a here-document (the <<<END syntax).




View Complete Forum Thread with Replies

Related Forum Messages:
Problem With Rendering The Page
I want to know if anybody can help me with a problem on pages i have rewritten into php last month. It;s like i used include command to assamble the page from html files...BUT ALAS :) IN MOZILLA (explorer does not appear to do this) left margin does not show at 100% height as it is supposed to ...to fit the other content, but it appears just as a line 1 in height so it actually does not fill the page. Of course i have checked the html code to ensure i have put 100% height tags into tables but still the problem persists...

View Replies !
Page Rendering Techniques.
I've seen recently don't create the website in html and then implement bits of php.  They render the site bit by bit by concatenating html onto a variable that is echo'd at the very end.  Where can I seek advice on how to go about this? Or can you give me some ideas..

View Replies !
MySQL Error Stops Page Rendering
Can anyone clue me on on how to have my html page continue rendering
past a MySQL error? If you visit www.Base2WebDesign.com, click login,
type in anything for a username and password, then view the page
source. You will see that the page displays the error then just stops
rendering the html. (I know what the error is, I deleted that table
on purpose for a simple way to show you what I would like fixed.)
This doesn't cause any problems on this particular page (other than it
fails vailidation) but I some of my website I have other information
below those errors and even the remainder of the page. If it hits an
error I would like the remainder of the page to still be displayed,
just display the error and keep moving. Is there anyway to do this?

View Replies !
Page Loades Part Of The Page
the below code is kinda working but its only loading part of the page, when I do a page refresh the rest of the page loads.  the part of the page that is not loading correctly is the bottom 1/2 which displays images. Code:

View Replies !
Caching A Part Of A Page?
I am working on a custom banner generator for some of our users.

Its basically a flash banner that can take vars for colors etc, so users can integrate with their sites colour scheme.

Its set up currently with the banner at the top as a preview, with e.g. .swf?color1=00000&color2=45efef in the object and embed tags.

Below this is a script that is 3 nested for loops, that increment a var each and convert that to hexidecimal. The three hex refs are then concat'd together, and set as a CSS background to a transparent gif with an href around that calls the same page with the new colors in the url, which get passed back to the flash movie. (hope im making sense here :))

So theres about 500 or so (im incrementing the vars by two,otherwise its way sloooow) <a><img></a> that have to be generated on each page load. Im wondering how and if i can speed this up?

View Replies !
Getting Part Of Another HTML Page
I'd like some help with writing a script that grabs part of another HTML page. For example : I want to grab the content of a HTML page that contains the following strings :

<!-- begin --> and <!-- end -->

Then I want to get all the content (including these two tags) that is in between the two tags.

View Replies !
Refreshing Part Of A Page
Can some one help me if it is possible to refresh a part of a page,
without reloading the whole page. Let's say, i want to add a small
message box to my webpage. After writing a message, the user presses
the send button and i want only this part of the page to refresh and
give him a status message saying his message was successfully received.

View Replies !
How To Let Php Reflesh Part Of Page
I want to write some code that when some variable condition is met, it will change a table cell value (only reflesh that value instead of the whole page),

I used to think it as calling JavaScript function first, which in turn change that table cell value in the page. But I don't know how to let php call JavaScript, or mimic click button action to call JavaScript.

View Replies !
Refreshing Certain Part Of Page
I need help with how to get my shoutbox I made to automatically refresh when someone posts a new shout.

View Replies !
Include Specific Part Of Page
i know that the include() function allows you to include a page with php but how do i only include PART of a page like specific tables? what im trying to do is get the certain parts of this page: ...

View Replies !
Need To Copy Text From One Part Of Page To Another
It has been great so far but I hit a road block on one thing and I figured the brilliant minds here could help. This site isn't in a database because its 3000 pages of HTML now and we figured we can do work arounds to make it look right. We are starting a database for future data though Code:

View Replies !
Extract Each Part Of A Page That Are Enclosed In A <b>-tag
I would like to extract each part of a page that are enclosed in a <b>-tag, but ONLY if there are no other tags enclosed.

<b>some text</b> <-- a match
<b>some text <i>in italic </i></b> <-- should NOT match

This is what I have so far:

$pattern = "/<b>(.*?)</b>/si";

preg_match_all($pattern, "<b>some text <i>in italic </i></b>", $out);

Any thoughts?

View Replies !
Loading Part Of Page Using Includes
If I use includes to create a website pages, how can I make sure that the header part I where i have a flash movie, will load only once?

View Replies !
Get The Value You Pass From One Page As Part Of The Query String?
How do you get the value you pass from one page as part of the query string i.e

htttp://www.somesite.com/postage.pgp?newsid=2

How you you get the value of the variable in the next page, stumped.

View Replies !
How Do U Code A Printable Output Of A Part Of Your Page?
im trying to develop a website and im wondring how to make a connection with a printer and make a printable version of the page

View Replies !
Change Part Of A Web Page After X Seconds Delay?
I was asking about how to pass a new array number with a page refresh and someone responded: But what I don't understand is why you want to change images like that on page reload, I have never seen it before.

That raised the question to me - if I have written out a web page in PHP that has an image displayed on the page - is there a way to have it change the image every 10 seconds?

Could you do this with a For Each or While type loop? I thought once the script was parsed it then wrote the page source and it doesn't change on the screen.

View Replies !
Php Form To Allow The User To Enter Part Of A Last Name And/or Part Of A First Name To Display The Data
I'm sure this is not a hard thing to do, but for some reason I can't get my mind to figure this out. I have a database with Name, Address, and Car Type tables. 

I'm just trying to do a simple php form to allow the user to enter part of a last name and/or part of a first name to display the data in the tables. My brain has twisted around this and I cannot figure it out.

View Replies !
Rendering PHP (into Html)
I've currently got a shell script running that grabs the pages, then renames each file to php, and then changes every link to point to .html instead of .php. This is a horribly bad way of doing it, but I can't figure out a better way. Sites like planetquake use a system to achieve this, does anyone have any idea how they do it?

View Replies !
PDF Rendering & Mac's
My system is currently experiancing problems caused by Macintosh customers using Internet Explorer to browse my application. My site generates PDF documents based on customer filled in fields. This is (of course) a processor intensive item each time a PDF is rendered.

The issue is that when a Macintosh user clicks on the link (which opens in a new window) and if the PDF doesn't appear immediately, most users will then click back to my application and click the link again, which starts up another instance of the PDF rendering.

I had one user, over the course of an hour, click and render over 100 PDF's! this cripples my site for other users to be able to generate their own images / PDF documents.
Has anyone else had this experiance? Does anyone know of a work around, or a way to force the Mac to wait for the PDF to download?

Could I set up a script that only allows the user to click on a link once every, say 30 seconds or so using Javascript? (So if the user clicks on the link, it pops up the window for the PDF, and if the user goes back to the main page and tries to click again, they'll recieve a dialog that says 'please wait 30 seconds and try again')

View Replies !
Selective Replacements
I have this in one of my scripts to take out line breaks:
$html=str_replace(array("
","
"),"",$html);

Now I would like to leave some line breaks.
For example, if $html has something like this:
"<textarea> default text
with line
breaks </textarea>"

View Replies !
Rendering Javascript?
I'd like to execute javascript if I'm in a certain directory. I can't
figure out how to render the javascript script below. I always end up
with some type of parsing error. Any suggestions?

<?php
$url= $_SERVER['PHP_SELF'];
$isWPAdmin = strstr($url, "wp-admin");
if($isWPAdmin) {}
else {

<!-- Start of Code -->
<script type="text/javascript" language="javascript">
var sc_project=1000;
var sc_invisible=1;
var sc_partition=101;
var sc_security="1000";
</script>

<script type="text/javascript" language="javascript"
src="http://www.abc.com/counter/counter.js"></script><noscript><a
href="http://www.abc.com/" target="_blank"><img
src="http://11.abc.com/counter.php?sc_project=1000&amp;java=0&amp;security=1000&amp;
invisible=1" alt="hit counter" border="0"></a</noscript>
<!-- End of Code -->

}
?>

View Replies !
Selective Conditionals
how can this be structured in a simple way so that variable values will be picked up when
each variable like 'cotton' requires all total variables - even if it is not defined within the condition.

So those variable left out of a given condition (those applying to all, if not defined within the condition) like $frame and $theme in this case, don't have to be specificied within each condition? Code:

View Replies !
Rendering A File
I'm trying to render a file using PHP (header). It works perfectly in Firefox and I get a dialog box to save or open the file, but in IE the open option is not working. I have to save the file and then open it, I can't open it directly. I get an error "Cannot save file in cache", is it related to my browser ?

View Replies !
Selective Selecting.
I have a 'search' form that lets users search my database. I have a set of checkboxes in that form.

[]Area1
[]Area2
[]Area3

I'm having trouble figuring out how to filter my database query based on which boxes are checked.

View Replies !
PHP5 XML/XSL - Rendering Strings?
The following code is what I am trying to achieve:

<?php
$data = '
<?xml version="1.0"?>
<page title="Simple XML">
<content>
<table>
<row>
<col>Row 1 Col 1</col>
<col>Row 1 Col 2</col>
</row>
<row>
<col>Row 2 Col 1</col>
<col>Row 2 Col 2</col>
</row>
</table>
</content>
</page>
'

$dom = new domDocument();
$dom->load("../include/styles/master-html.xsl");
$proc = new xsltprocessor;
$xsl = $proc->importStylesheet($dom);

$document = new DomDocument();
// $document->load('simple.xml'); // This works
$document->load($data); // This doesn't appear to work
print $proc->transformToXml($document);
?>

I can verify that the xsl transforms the $data if it is in a flatfile
(simple.xml). I am trying to render the data as a string into html,
however, and it doesn't appear to be working.

Can I even do a transform in this manner, or am I missing a critical step?

View Replies !
Rendering Form Input
I created a basic forum. If someone tries to post something like the following:
I ' m   r e a l l y   b o r e d .It comes out like this:

I ' m r e a l l y b o r e d .I know it's an HTML limitation.

What can I do so what it will render every character typed? Here's my code:

View Replies !
Selective Recolor An Image
how might one recolor an image..so that, for example, all shades of purple are converted to shades of red?

View Replies !
Selective Feedback Form
The site that I'm working on has a number of members who each want feedback sent to their own email address. I obviously don't want to create a form for each member, instead I want a visitor's click on a desired name to make that specific member's email address the one that the form uses.

After doing some reading I'm more lost than ever, my initial plan involved creating a page which contained an array of addresses. I am of course now questioning the whole idea as it was mostly based on using a function similar to onclick.

View Replies !
Selective Timed Loading
How do you make a web page load the top of the page (like the head and menu and stuff) before the content and the images in the body? I've noticed that sites like Yahoo! does this and I can't figure it out. I think it's some kind of preloading function, or maybe a include command.

View Replies !
Form And Selective Url Destination
When someone selects Microsoft Access, I want them taken to url A. If they select Microsoft Excel, they will be taken to url B. And so on. How can I achieve this?

View Replies !
Selective Session Timeout
My understanding with session timeouts is that, after a specified period of no activity, the session will end and session data lost. is this correct? I'm currently seeing behaviour that looks like data put into the session 2 pages ago is gone, but data put into the session 1 page ago remains. Just wanted to check my understanding. It's all or nothing, right?

View Replies !
Heredoc Code Rendering
I'm trying to start writing some of my code using heredoc strings instead of double quote, but I'm running into an error. I try to preview this file on my local machine and just get a blank page. But when I upload to my server. It works fine! I've checked for spaces, tabs, etc I'm using Apache/1.3.33 (Darwin) PHP/5.0.4 on a G5 Mac with OS X Tiger
PHP Code:

<?php
error_reporting(E_ALL);
echo <<<EOT
testing
EOT;
?>

View Replies !
Are There Any Good Email Rendering Packages For Php
I want to take an email and render it in a browser. I did a fairly extensive search for such a beast but couldn't find one.

I assume it would require a MIME parser and a renderer.

View Replies !
Selective Form Data Processing
I have *quite a bit* of form fields for a certain form that needs to be eMailed. The problem is that when completely filled out, there is quite a bit of information to be emailed. How would I go about telling the PHP to ignore any forms that are not filled out -- letting it process less code? If this helps, the coding for the page that does the actual processing is: Code:

View Replies !
Selective Echoing And Database Select
I have written a search engine for business listings for the company I work for. Each listing is in a database, and that works fine. The problem though is two-fold.

The first part of the problem is that not all listings utilise every column of the database, and this leaves gaps when echoing the results. This is not what i had in mind, Any ideas/help would be appreciated.

The second part of the problem is related to the first in that there is a link for any listing that has a website, but not every listing has a website, so every listing having a "Visit our Site" link is impractical and shoddy. Also, i'm not sure how to echo the url from the database effectively in the first place.

View Replies !
Selective Permission To Write In The Directory.
I want to create a publicly accessible php page which will generate
images (with the GD library) and store them in some directory. For
this I have to change the permission of directory (it has to be
writable for everybody). However, as far as I understand, this will
allow everybody to put in the directory whatever files. I would like
that only my php program has permission to write to the directory. Is
there any possibility to do that?

View Replies !
Weird Characters Rendering In Firefox But Not IE
So I have a simple include file (a footer) that renders some odd preceding characters:

I am getting some odd characters appearing in the beggining of an include when rendered in firefox (v 1.5x on XP Pro). The characters are: 

These are not appearing in IE6

Any ideas on what is causing this?

The include line:
<?php
include_once ('rootdir/filedir/filename.php');
?>

This is not occuring for other included files. This is the last include on the page.

Include file source:....

View Replies !
Copy Selective Data From One Table To Another
I have one studentinfo table with the fields of

Id, studentID, ExamDate, Service, Age, CPTID, ICDID

In my database, I have some almost duplicate records with only different CPT codes like the following

Id, PatientID, ExamDate, Service, PatAge, CPTID, ICDID
1 91959954 2005-07-09 20 39 92060 378.9
2 91959954 2005-07-09 20 39 99213 378.9
3 187093 2005-01-06 6 26 92016 743.2
4 67206 2005-01-06 270 72 92012 371.6


In this case, record 1 and record 2 have the same data except the CPTID, thus I know this is the same student doing the same exam. Then what I need to do is to merge these two records and insert his info to a new table with the fields of

Id, studentID, ExamDate, Service, Age, CPTID1, CPTID2, ICDID

Any thoughts on how to do this?


View Replies !
Rendering Index "form" As Invisable?
does anyone know how I can render/wrap a search form code as invisable to search engines?

The trouble i am finding is that when I run search engine simulators, they bring up all of the internal values of the search as text on the page, as below,

"" Price Minimum £113928 00 £166632 00 £193683 00 £368920 00 £664056 00 Maximum £113928 00 £166632 00 £193683 00 £368920 00 £664056 00 Bedrooms Minimum 10 11 12 13 14 15 16 17 18 19 20 Maximum 10 11 12 13 14 15 16 17 18 19 20 Bathrooms Minimum 10 Minimum 10 "".

View Replies !
Can A "selective" Table UPDATE Be Done?
i have a table with a column of data type smallint. how could i increase that number that's stored in the smallint by 1...only when certain pages or conditions are meet, in other words...an autoincrement is not wanted here because i don't want to increase that # by one each and every time the table is updated (for other columns).

is it possible to do an UPDATE (with a ++ on the column) on the table w/o first doing a SELECT to get the present number?

View Replies !
Getting Part Of A String
What I am attempting is to retrive part of a string, the string comes from TEXT field in mysql db using mysql_fetch_row. It is an article, in the article there is flags like for example [image]img=34,align=left[/image].

Now I would like to retrive the [image]img=%[/image] part to be able to use the wildcarded number for a database query to get the image link and image comment then giving it all a proper html formatting. After that, I replace [image]img=%[/image] in the original string with the newly formatted html.

View Replies !
Extracting Part Of Specified URL
I have seen some tutorials on how to retrieve a section of the current URL with php, but what I am trying to do is a little different. I need to be able to specify any myspace URL in a form and have the output be a section of that URL. For example:

I input the following URL into a form field:
http://www.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=257367900

when the submit button is pressed the output should show:
257367900

I need it to be so that I can input any myspace url as such and the output will be everything after the "&friendid="

View Replies !
Stripping A Part Of The URL
I am planning to make a site where users can enter a video's url (youtube and such) and the video will be embedded into our site. Code:

View Replies !
Get The Last Part Of An Array
I am trying to preselect all the checkboxes on an edit form if they are part of the record in the database I put this to get an array of categories that pertain to that record being edited. Code:

View Replies !
Selecting Part Of A Value
Learning php and mysql, and frankly it's making my head spin... Anyway, how would you get a result and output only part of it? Like get "2004" and only output "04". It's probably a stupid question, but I can't seem to find the correct syntax in any of the manuals. Specifically, I want to output the standard mysql "0000-00-00" date format as "mm/dd/yy".

I know there are scripts out there for dates, but I don't want to do anything fancy with it, just switch some numbers around and output part of a result (plus I'm trying to learn this stuff, and this seems like a question that will provide answers for other things as well). An example script would help me alot. From what I know so far, I think the answer would be to select the field, explode the string, then assign and output the variables with "/" in between.

View Replies !
Get Part Of A String
if I could use php and get certain parts of a string like $string: = "<table><tr><td>Name</td><td>Desithugg</td></tr></table>";

Would it be possiable to use something like preg match to get only that part Desithugg into another string like $name. So I want to get the part between <td>Name</td><td> and </td></tr>. If it's possiable can anyone give me an example. I tried looking at the manual but didn't quite get it.

View Replies !
Get Part Of A Integer
just like you have substr() to get part of a string, is there a way to get part of an integer?

$myVar = 20060103142005;
// and want
$myVar = 20060103;

what's the best way to do it?

$myVar = 20060103142005;
$myVar = substr ($myVar, 0, 8);
echo $myVar;

doesn't work. Trying to convert the number to a string doesn't work either: Code:

View Replies !
Part Of A Script
Apparently there is a problem with part of a script, this is the problem part: Code:

$member['reputation'] = $this->html->reputation_level( $member['id'], rtrim($member['rep']) );

View Replies !
Update Part Of A Row
if it's possible to update part of a row in phpmyadmin? I know how to do it with a PHP script but phpmyadmin would be better in this case.

Example: The value of the row is BBB001, I want it to be ABB001. It's only the first character of the row I want to update.

View Replies !
Last Part Of IP Address
For example if IP address is 64.12.34.56, I want to display it like 64.12.34.**

Here is my code:

$this_ip="64.12.34.56";

$this_sub_ip=substr($this_ip, 0, strrpos($this_ip, ".")+1);

$this_sub_ip_replace_length=strlen($this_ip)-strlen($this_sub_ip);

for ($index=0; $index<$this_sub_ip_replace_length; $index++)
{
$this_sub_ip=$this_sub_ip."*";
}

echo ($this_sub_id);

View Replies !
Get PART Of A File (via ID)
So I want to get part of a file, specifically everything WITHIN the div id="left". I have this code, but it gets the whole file. I want to use this to edit a remote file test.html). Code:

View Replies !
Using Only Part Of A String
Pulling data from old DB to new DB. One field is text for an article, I need to pull it and only get part of it for a new summary field. How can I get just part, say 1 or 2 paragraphs out of the string?

View Replies !

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