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.





How To Print The Local Variables Used In A Generated Page


I am still a beginner of PHP, and while I found out the way to print
all the variables passed as a POST, I was wondering (for debugging
purposes) if there is a simple way to tell the PHP interpreter to print
out all the variables that have been used during that session, without
storing anything anywhere, and without buying a commercial tool.




View Complete Forum Thread with Replies

Related Forum Messages:
PHP-generated Link To Local File Doesn't Work When Clicked On. Why?
I'm running an Apache server on my own computer (Windows XP Pro).

I wrote a simple PHP script (called test3.php) that I'm running by
putting the following URL in the address bar of the browser (Firefox)
....

http://localhost/test3.php

The script generates the following link using the echo statement ...

<a href="file:///C:/pictures/xyz.jpg"> Picture </a>

("C:/pictures/xyz.jpg", as you can guess by now, is an image file on
my harddrive, but it's not in the document root).

When I clicked on the link, nothing happened. However, if I
RIGHT-click on it and select "Copy link location" (which copies the
URL to the clipboard) and then paste the URL into the address bar of
the browser, the picture then displays correctly.

Why did it not work when I clicked on the link the first time, but it
only worked when I pasted the link to the address bar?

Is there some special notation/syntax that I need to use to get this
to work properly?

View Replies !
Local Variables
I am running a virtually hosted domain on a server that I have root access on also. I rented the server, but the hosting company supply no information on the setup. I'm forced into using their control panel to add domains.

Running a phpinfo() on a virtual domain I have found that although I have set safe_mode to off in the php.ini file something is setting the local value for safe_mode to On.

There are no .htaccess files in the heirachy of folders to the virtual domain. I've checked the <virtual hosting> directives in the httpd.conf and I cant see anything there that might be doinng this.

View Replies !
Mail A Php Generated Page
I ask if it's possible to sent to email a php generated page as an html attachment or text file !?

I have searched on google, but I find only how to send mail from php not hot to send a page.

Any link, or doc is helpfull !

The story:
I have a long products list, from where I select some items what I want to send as a price list to some people.

View Replies !
Randomly Not Generated Whole Page
I bump into a weird problem. Randomly a page is not fully generated. When I reload a page most of the time it's OK but sometimes (without any apparent logic) only a part is generated and sometimes some PHP errors appear (about missing functions, unfisnished regexp etc.) as though some scripts were not properly parsed or loaded.

The application itself ran without any problems on other two servers. The server where the problem occurs is FreeBSD, PHP4 with AfterBurner accelerator. Unfortunately, I don't have access to the server, so I cannot check further settings and logs. Does anybody have an idea what can be going on?

View Replies !
Page Generated In XXX Seconds
I was reading a post here and toplay referred someone to the http://theomega.org/ for captcha info. I went to checkit out and noticed that on the bottom of the page it said:

Page Generated In: 0.1911 seconds.

View Replies !
Local/global Variables
I've problems including global variables in my functions. for instance, how do I extract $REMOTE_ADDR, or a session variable, inside a function ?

View Replies !
CGI Variables: /usr/local/bin/php Test.php --x=hello --y=123
My question is the following:
I'm calling a PHP script as CGI over a shell a.e:
/usr/local/bin/php test.php --x=hello --y=123

How is it possible to access the variables x and y in the script.

is there a special array where these variables are stored?
I tried $_ENV and $_GET but it didn't work...

View Replies !
Local/Master Variables
Im trying to get my apache server to run php in none-safe-mode (safe_mode == "0"). It is set like this in php.ini, however, when i look at a phpinfo(); it shows that locally this is still set on, despite the master being off. I cant find config files specific to each domain on the server - nor can i see anywhere in php.ini where other configs are included. I've tried an ini_set("safe_mode", "0"); but that didnt help. Does anyone have any ideas as to how i might be able to sort this?

View Replies !
Are Multiple GD Generated Images Possible On One Page?
I've been experimenting with generating PNG files via PHP and GD. All was going fine, until I tried to put more than one image on a single page.

<img src="draw.php?text=Picture1"><br>
<img src="draw.php?text=Picture2"><br>
<img src="draw.php?text=Picture3"><br>

The example above produced 3 images, but they all have 'Picture3' on them. Seems like theres only 1 temp storage area for the images?

View Replies !
Refreshing Page Dynamically Generated
We have a problem with a PHP page on our site, the page is dynamically generated from a database, when we refresh this page after we have updated the database it will cycle though and refresh itself about 8 or 9 times before displaying the page, at first i thought it was the browser, but it does it on a couple of other machines too.

View Replies !
Placing A Generated Image In A Web Page
The task is: Iam using a .php image generator ( namely Stewart Rosenberger's Dynamic Heading Generator) to convert a text string to a .png image.

The text is input by a simple HTML form on a web page using the GET method to call the script 'heading.php'. 'heading.php' outputs the required .png image back to the browser from (I presume) the function: Code:

View Replies !
Defining Variables - Print The Variables
Can it be done? I ve been searching the net for ages looking for tutorials or examples and i cant find anything. What im trying to do is something like this:

<?
if ($variable == "blah")
{
$a = 1;
$b = 2;
$c = 3;
};
{
echo ($e . $f . $g);
};
?>

Ive tried about a hundred different ways of doing it, but none of them print the three variables. what im doing wrong or give me the correct coding for this?

View Replies !
Register_global = On, Mix Between $_SESSION And Local Variables
I'm coding Php under register_global = off flag, but, most (all ?) of php
hosting companies use the "on" flag with their shared servers...
I spent too much time to finally discover that my sessions went mad because
the $_SESSION['pseudo'] was updated by a simple $pseudo = $row['pseudo']
(from the DB)...
It's ok when, on my local conf, i use it with the register_global = off, but
once uploaded online, on a shared server with register_global = on, sessions
goes mad... I use the built-in php session mechanism and the file where
information session is saved is updated in a wrong way because of this
mix...

Is there another way for me than avoid using same names with my $_SESSION
stuff and other local variables ?

View Replies !
Passing Variables To A Local Application
1) is there a function in PHP similar to Javascript's shell.run(application.exe)?

2) If so, can variables be passed along to the program?

Specifically, I have a program (a glorified DOS batch file) that users currently have to enter perimeters & execute from a DOS command prompt. I'd like to have a form online that would pass the same variables to the local dos program.bat file and run it. Is this doable?

View Replies !
Local Variables With The Same Name As A Session Variable
I have REGISTER_GLOBALS set to off and i have a local variable with the same name as a session variable. For example, i have a local variable $username and a session variable $_SESSION['username'] and when i assign the local variable $username a value, the session variable $_SESSION['username'] is also getting assigned this value. Does anyone know why this could be happening?

View Replies !
Writing A PHP And Javascript Generated Page To A PHP Variable...
I have a form that posts data to a PHP mailer page I have created. When
it goes to the PHP mailer page it reads some of the data and modifies
the page accordingly using Javascript (hiding certain divs, etc...). My
goal, is to take all this data after it has been processed by
Javascript and send it through my PHP mailer as it is currently
formatted.

If it helps any, the track I am on right now involves encapsulating the
Javascript processed block in a div. I am then trying to take the
..innerHTML data from that div and store it in the PHP $message variable
for my mailer. This won't work because PHP is server side. So, I moved
on to generate some Javascript code (with PHP) that sends all that
messy HTML data that its processed through a URL variable to then be
read by PHP. This doesn't really accomplish what I want as it cuts off
about a quarter of the way through my data......

Any ideas?

One thing I thought of but don't know how to do or whether it's even
possible is using PHP to view the source of the current page and store
that as the HTML to be e-mailed. Or, is it possible to do something
similar to .innerHTML with PHP?

View Replies !
Displaying Html Code On PHP Generated Page
I am trying to create a link page in my php application. this is a page that will display a block of html code that a visitor can copy and paste into their web site to create a link back to mine. My PHP page has a line in it like this:

define('TEXT_INFORMATION', '<html page code is here>');

I have added the html code to create the page as noted above. the page contains a same of the banner image file and the html code that goes alon with it. My problem is that I haven't been able to "quote" the html code so that ir will not be executed.

every time I try to run the application from my web server my page will display two copies of the banner iimage not on banner image and text block like it should. Any suggestions?

View Replies !
Call A Separate .php Page That Is Automatically Generated From The Values Of The Xml Document.
I generated an xml file. I have an xslt to sort the xml file and look for certain words.

The user should be able to view the page and click on the url to a specific 'article' that the xml sheet generated. I want this url to call a separate .php page that is automatically generated from the values of the xml document. Is this possible? How do I do that? Code:

View Replies !
The Dots (.) Between Variables For Print & Echo
I've seen this a number of times when people of posted code to try to explain a concept or code snippet, but I don't know what it means or it's proper use:

print('well, hello ' . $person . ', nice to meet you!');

I'm talking about the "dot" before and after the $person variable. What is the function of this dot.

View Replies !
Can't Read Remote Web Page From Local Apache/PHP
I'm trying to read the contents of any Web page on another
host. I'm finding that...

echo file_get_contents( 'http://www.php.net' );

.... works fine if I upload the PHP script to my Web host, and run it
there. But if I run it on my PC, which is running Apache 1.3.33
(Win32) and PHP 5.0.5, then it always times out, and gives me the error
message...

[error] PHP Warning: file_get_contents(http://www.php.net) [<a
href='function.file-get-contents'>function.file-get-contents</a>]:
failed to open stream: A connection attempt failed because the
connected party did not properly respond after a period of time, or
established connection failed because connected host has failed to
respond.

I get the exact same results using...

$fh = fopen( 'http://www.php.net', 'r' ) or die( $php_errormsg );
while (! feof($fh)) {
$page .= fread($fh,1048576);
}
fclose($fh);
echo $page;

Anyone know what could cause this to happen?

View Replies !
Link To Local Files Through A Dynamic Page
I decided to flesh out my php skills by building a web application
which could scan through local files on my intranet (specifically
mapped drives on my server) and generate a list of Movies or pictures
or music, etc. Which worked fine, I created the code to do that and to
store the results in a mysql database. I can even print it out to a
..php page and sort it however I like.

What I can't seem to do is to create links to the data I've indexed in
a way that will let me open them from the generated php page. I've
searched and searched and there just doesn't seem a way to do this.
I'm pretty sure I've exhausted the obvious options.

The following trials did not work when the document was served from an
apache web server.

<?php
echo "<h1><a href=file:///c:/temp.txt> HEY </a></h1>";
echo "<h1><a href=file:///c: emp.txt> HEY </a></h1>";
?>
<a href=file:///c: emp.txt target="_top"> temp.txt </a>
<a href=file:///c:/temp.txt target="_top"> temp.txt </a>

When the same page was loaded directly from the file instead of served
through apache the bottom two links worked. This doesn't really help
me however. I need to be able to dynamicly generate pages that link to
the files.

I've read that browser security is the restricting factor in this but
changing all of my security settings in IE to low didn't seem to affect
it (not sure what the equivalent of security settings is in Firefox).
Does anyone know of a way to link to local files directly in a way that
lets you open them directly from the source instead of by downloading
them to a temp file or saving the file to somewhere locally? Is it
even possible in PHP?

View Replies !
Connect Page (local) To Remote Database:
I'have Easy PHP in localhost and i need connect php page (local) to remote
database:

$db_host = "62.149.225.23";
$db_user = "gfo";
$db_password = "gfo";
$db_name = "gfonline";
$db = mysql_connect($db_host, $db_user, $db_password);

The browser show this message:

Warning: mysql_connect(): Can't connect to MySQL server on &#3962;.149.225.23'
(10061) in e:phpgfonline.itprovaremoto.php on line 7

View Replies !
Hyperlink From Intranet Web Page To Local Files On My Computer
I'm creating a company intranet, and every employee has certain
program we want them to be able to run from it, meaning we want the
link to the program to be on the intranet page. For example, Adobe
Photoshop resides on all the employees computer under "C:Program
FilesAdobePhotoshop 7.0Photoshop.exe"

However, when I enter that as a hyperlink on the page, it does not run
the program.

Is there a way to get a web page to run a program on the local host?

View Replies !
404 Page Print Url
I have made a cistom 404 page on my server. FOr some reason though, the way my host is it doesn't keep the link that someone tried to go to in the address bar. So when someone goes to a 404 it just shows the links to the custom 404 page in the add. bar. I want a php script to print the url in the add. bar. Also, a script to make it say like on the page: $url could not be found blahh blahh.

View Replies !
Print Page
I am using include(); to bring in the text from a .htm file into a webpage. But I want the viewer to be able to print this page, ie all the page content showing the company header and footer and the include in the middle.

View Replies !
Redirect Page On Remote Web Host When Local Server Is Offline
Hope some one can help . I have my web site hosted on powweb (my remote web host)and I want a user to be redirected when they access my local server through a link on my remote web site to another page on my remote web site when my local server is offline.

View Replies !
Automatically Print The Corresponding Value In The Same Page
i have 5 sets of text boxes in the table. what i was thinking to happen is like, when i input something in the text box 1, and hit a certain key (tab-key or whatever key), it'll automatically check the database, and when it reaches it's corresponding value, the value will be printed out in the same page i'm accessing.. and then, i can type again to fill other text boxes.

View Replies !
How To Print The Page To The Printer.?
how to print the page to the printer.? when we enter the print button.

View Replies !
Print Page Through Printer
i have created one table in my php file filled with information about student. and i want to print this page through prinnter wby pressing press button at button of the page. how to do that? how to print from the printer in php.

View Replies !
How To Print Certain Portion From A Page
In my web page, I have some tables, some images. I want to have a button, so that I can print any table or any image (not whole page) of my page. Is this possible?

View Replies !
Print Page Numbers
I am generating a report which consists of atleast 50-60 pages. My client wants me to prepare one index page where contents are printed with page number for eg:

REPORT

Analysis pg: 1-3
Ullage report pg: 4-5
Health Certificate pg: 6-9

All the data will be coming from database. Doesnt matter if the report is generated even in pdf format. How can i achieve this

View Replies !
Print Button On Web Page
How to add a print button on a web page in php.

View Replies !
Multiple Tables Print To One Page
Is it possible to print information from multiple databases on one page/form.  For example, I want to print information that is in three databases, and I want to be able to print a few related fields on one page.  Is that possible?

View Replies !
Print A Javascript Variable On A Page?
My free javascript shopping cart (NOPCart) creates a table on the checkout page from a javascript routine. But I want to be able to carry those values forward, and I can't figure out how to do it. I'm on a PHP page. Example:

Shopping cart returns a total order amount of, say, $99. It does this using a "drawcart()" function.

How do I add a line later that says:

"I authorize you to charge my card $99"?

I've tried <? echo="$Total"?> but it didn't work. Surely this is an easy thing to do, and its just my newbieness getting in the way.

View Replies !
Send Data To Print One Page At A Time
I currently have a script together that will display one record per
page and allow the user to manually click through pages to view the
next record. How can I translate this to printing the data? I want
to be able to print the data one page at a time, but only send one
print job to do this?

I have never done this before, but would imagine it is possible....

View Replies !
How To Print Data On Paper With Header In Each New Page?
I am getting stuck at a point in my project.

I would like to give functionality of print data from site. but there
is a problem is that if there are lots of data which takes multiple
pages to print then I need to show header that indicates coloum name at
top of each page so can any one help me how to do that.

the main problem is there are muliple line for each row so I could not
make condition depends on some fixed rows concept. So Please keep this
in mind.

Let me give u visual for my problem.

First Page will prints as follow:

View Replies !
Print Code With Line Number On Web Page
I read HTML code from a url and I need to replace 'Beginning of Line' and 'End of Line' with line number.  However, I do not know how this can be done. Any help would be really appreciated.

$enews = file_get_contents("http://my.sony.co.th/newsletter/issue/issue-MySony061aug22/index_en.html");
$enews = htmlspecialchars($enews);
print "<pre>$enews</pre>"

View Replies !
Browser Emulator Print Html Web Page To PDF
We need to have PHP print a Web page, from another server, to PDF.

What we don't need is for PHP to read the code of the Web page and print the code to PDF - we need PHP to actually print exactly what the Web user sees in their browser, just as if a Web user had navigated to the page and had their browser print the page.

I've extensively searched for a script to do this - I believe it will have to be written but don't really know where to start. It seems like the code would have to be some kind of Mozilla emulator.

Any suggestions for other solutions would be appreciated too - perhaps a non-PHP, client-side script that actually opens Mozilla, gives it the URL, then engages the print function.

View Replies !
Using The GET Function And Passing The Variables From The Remote Location To The Local Location.
I have an local and remote database and i need to update the local one with some of the details obtained by the remote one, I have tried to do this using the GET function and passing the variables from the remote location to the local location. I am finding that this is not a very relible way of doing this, does anyone have any idea about how i can do this in a better way.

View Replies !
Embed Php Generated Html In Another Html Page
I am trying to include some php generated html in a page that is just a standard html file, NOT a php file. I have seen other html pages do this by including an src to the cgi script in script tags, like this:

<script src="http://someurl.com/somescript.cgi"></script>

the html page loads and the script is executed and the returned html is displayed in the calling page. So, I tried this:

<script src="http://someurl.com/somescript.php"></script>

It doesnt work!!

View Replies !
How Can I Pass Variables From The 1st Php Page To The 2nd Php Page Without Using Cookies
How can i pass variables from the 1st php page to the 2nd php page without using cookies or passing through the URL from an <a HREF="2ndpage.php"> link? the variable consist of 200 characters. for example some code

//for example i get the variable $variable from the db.

while ($row = mysql_fetch_array($result,MYSQL_ASSOC))
{
<a href=&#392;ndpage.php'>
}

View Replies !
Passing Variables From Page To Page
I just need to know how to pass variables from page to page on my form.

View Replies !
Passing Variables From A Page To An ASP Page?
I have a site using a PHP CMS and I need it to use an ASP module from
another site but I would like to use a frame so it looks like it is
still in the same site.

I need to pass a username variable from a form in in the PHP webspace
(where the domain is pointing) to a page in an ASP webspace (using a
subdomain not related to the main domain).

I created a frame page in the php hosting with a 1px top frame and the
main frame pointing to the asp page but of course the variable is not
being passed.....if I put the ASP connection code on the frameset page
it doesn't recognize it because the hosting is a Unix/PHP hosting
only.

My question to you is:

Can a variable be passed from the php to the ASP webspace using some
other technique?

I just need to have the ASP module showing as if it is in the PHP.

View Replies !
Carrying Variables From Web Page To Web Page
I was reading about PHP variable scoping - it doesn't seem to support
carrying any variables from one web page to another - how is this
usually done? I have a lot of php variables created on my home page
that I need to make use of on other web pages - how can I do that?

View Replies !
Functino That Can Use To Print Instead Of Using Javascript, Window.print()??
is there a php functino tat can use to print instead of using javascript, window.print()??

View Replies !
LOAD DATA LOCAL INFILE - Workaround For Local-infile=0
I'm using a PHP script for updating my database which relies on the "LOAD
DATA LOCAL INFILE" command. As my provider recently updated the
MySQL-database, he changed the "local-infile" setting to zero, i.e. my
update-script doesn't work anymore (=> "The used command is not allowed with
this MySQL version").

Is there a work-around to fix this problem? I though about the mysql_options
command, but to frankly speaking, I have no clue how to use it and couldn't
figure out how to properly use it even after reading the manual ... anyone
who could help?

View Replies !
Print Function To Print Text
Perl has a print function that'll allow you to print text without having to comment out Perl interperated characters. For example:

print<<EOF;
Text goes here, blah blah blah blah, """,... $$&$&$,
EOF

Does PHP have a similiar feature?

View Replies !
Variables From Another Page
I am working on something and was wondering if the following is possible... ( I have tried it and am getting a blank instead of the value required).

Do I have to declare the name variable in Page1... or is there a way to go around it?.. One solution could be sessions...but Is there another solution? Code:

View Replies !
Variables From Another Page
how to get a variable from another PHP page. Does someone know of a good tutorial for this? Is it easy enough that someone could just show me?

View Replies !
Transfer Variables To Another Page
I have a script that on the first page is a form for users to fill out, when they choose to submit the form it goes to another page that actually processes the form to my MySQL database. ATM I use statements like this to carry over those values:

$article_author = $_POST['news_author'];

Is there a better or more effecient way to do this? It's not too bad on a short form, but typing out all those lines for a long form is tedious.

View Replies !
Getting Variables From One Page To Another Without Globals
I have this problem getting one variable from one page to another. I don't want to use globals since they arent very good i've heard. (this is how i've done it in the past)
Now, i thought of doing a form post from every page and posting everything forward but it seems silly, also, i don't think i want to store all the information i used to keep as globals as cookies, it seems to me to be just as insecure.

This must be a common thing to do in php and so i'm kind of wondering how to get it to that other place? Is there some kind of special way to put it there?

View Replies !
Passing The Variables To More Than One Page
I have an initial page 'page_one.php' that sends the data to another one - 'page_two.php' using form. It sends a couple of variables collected from the user input. Now....'page_two.php' has header function before any html that is either skipped or executed based on the user selection. If it doesn't come to header everything is fine, but if it does - header redirects 'page_two.php' to 'page_three.php'.

Now, I want to be able to view all the selected variables in 'page_one.php' in my php code in 'page_three.php'. In another words, how do I pass the variables to page_three.php if it's not declared in action='...' located in 'page_one.php'?

View Replies !

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