PHP/HTML Displays
I am using a PHPed version of an HTML file in order to include an onload function to write to a log file. The problem is that large parts of this file display as garbage 9 times out of 10, and sometimes again with a refresh.
Is this a HTML or a PHP problem?(it doesn't occur in my other HTML only pages)
If it is a PHP problem, is it a question of delaying script execution until images are displayed? And how do I do that (or whatever else may need doing)?
View Complete Forum Thread with Replies
Related Forum Messages:
Script That Reads My Log File And Displays It In An HTML Page.
I have a problem. I am trying to make a script that reads my log file and displays it in an HTML page. I got the base code from a book, being that I am still learning PHP and I needed a little help starting out. But the code I am using gives me an error. The error is : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 15 It ranges from to line like so : Fatal error: Maximum execution time of 30 seconds exceeded in /home/sites/home/web/php-site/log-file.php on line 27 I want to know if anyone knows the specific reason or maybe a place to start at to find out the problem and the solution.
View Replies !
PHP Page That Displays Html Based On The Address Enterd
I would like to have a PHP page that displays html based on the address enterd. For example: index.php?example=a would show a page with <body>Example1234</body> whereas index.php?example=b would show a page with <body>Example5678</body>. I've done this before, but I can't remember the code I used.
View Replies !
IE Displays Php Different Than Mozilla
I have a wierd thing where for some reason internet explorer processes the php differently than mozilla, something i find interesting since i thought that php was run on the server side and the only the result outputted to the browser. I have on my page a top flash banner that i only want it to show its animation every couple of pages rather than every time a user clicks on a link so i threw this code together (probably considered sloppy, i know there is even some redundance that isnt needed but this is the result of rewriting it several possible ways to try to make it work correctly .....
View Replies !
How Php Displays The Output?
If I have a PhP code below in a linux+apache environment, ============================== <?php> the first php block code <?> The HTML code goes here <?php> the second php block code <?> ============================ does php open a temporary file to store the output from "the first php block code"? then combined with "The HTML code goes here" and then the output from "the second php block code"? Then display the output of this temporary file to web client and remove this temporary file afterwards?
View Replies !
Calls On A CSV And Displays Every Row
I have a script that calls on a CSV and displays every row. At the moment it seperates each field with a comma. I am struggling with how to seperate each field and put it into a table column. Can someone push me in the right direction. Code:
View Replies !
PHP File Displays
I'm having a strange problem when upgrading the content management system eZ publish from PHP 4.4 to PHP 5.1. Some cache files related to i18n are included with the "include" function, but they are being displayed to the user agent instead of being parsed by PHP. With PHP 4.4 there was no problem.
View Replies !
Sort Displays
I don't know what's wrong with this coding, I get an error Notice: Undefined variable: orderby in F:Htmlfsyc_databasegraduates_list.php on line 11 Notice: Undefined variable: color in F:Htmlfsyc_databasegraduates_list.php on line 30 <? $connection = mysql_connect("localhost","****","********"); $db = mysql_select_db("job_seekers", $connection); $table_name = 'personaldetails' If (isset($sorting)) { $orderby = "ORDER BY $sorting "; If ($sorting == "personaldetails") { $orderby .= "ASC"; } else { $orderby .= "DESC"; } } $sql = mysql_query("SELECT * FROM $table_name $orderby"); ......
View Replies !
Header Sometimes Displays Sometimes Downloads
using Javascript - open a new window: $s=contents of database field in rtf format header("Content-type: text/rtf"); echo $s; This works perfectly in Safari (Mac browser) but in both Netscape and IE5 it tries do download. If I use: header("Content-type: text/rtf"); it downloads in all browsers. I have two questions: 1. How do you know which behavior to expect (download or display) 2. I want to display an RTF file in a browser window. Is there a way to do it that works in IE and Netscape?
View Replies !
Displays A Date From A Database
I have a script running (with great effort and help from the group) that displays a date from a database and the amount of days to that date. I would like to change the date into a more "human" format. The date now displays: 2002-12-08 I would like to change it to: Sunday, December 08th Is this a property of mktime()?
View Replies !
Pear DataObject_FormBuilder Displays Nothing
I'm having problems getting the FormBuilder package to work. I've spent the last 3hrs reading what little documentation and examples I could find and the idea seems great, if only it'll actually display a form. I'm not getting any error message, and I know that my DB_DataObjects are working as I'm able to auto generate the classes and search them. However using the following code which I believe is meant to display a form for the 'users' table, does absolutly nothing except displayed <html><body></body></html>. I did some experimenting to see if there was something wrong with displaying anything, and I found that nothing would print after $builder->getForm() and I have no idea why : CODE: require_once('DB/DataObject.php'); require_once('DB/DataObject/FormBuilder.php'); $config = parse_ini_file('example.ini', true); foreach($config as $class => $values) { $options = &PEAR::getStaticProperty($class, 'options'); $options = $values; } $_DB_DATAOBJECT_FORMBUILDER['CONFIG'] = $config['DB_DataObject_FormBuilder']; $building = DB_DataObject::factory('users'); if (PEAR::isError($building)) { die($building->getMessage()); } $builder = DB_DataObject_FormBuilder::create($building); if (PEAR::isError($builder)) { die($builder->getMessage()); }
View Replies !
Mysql Select Displays Nothing
I'm having some trouble with this script. I have within a table the column "item1name". When I try and run this script everything echos out okay yet the final if statement always displays nothing when there is actually text in the column specified. Any ideas why this is happening? <? $userid="2"; $refslot= "item1"; $ex= "name"; $refiname= $refslot.$ex; echo $refiname; mysql_connect("localhost", "xxx", "xxx") or die(mysql_error()); mysql_select_db("xxx") or die(mysql_error()); $query= mysql_query("SELECT * FROM pcitems WHERE userid='$userid'")or die(mysql_error()); while($row= mysql_fetch_assoc($query)){ $iname= $row['$refiname']; echo "Working"; ................
View Replies !
Multi Column Displays
I'd like to know if there's a good tutorial around that can help me regarding multi-column displays. I'd like to work on photo galleries where the table displays 3 images across, until the last item. Apart from this, I'd like to have some sort of tutorial wherein I can display more columns at a time.
View Replies !
Code Displays In All Browsers
I have installed Apache 2.2.0 and PHP 5 on a Fedora Core 4 box. Both installs finish without an issue but when I check info.php on any browser (have tried IE, Netscape and Firefox) it just displays the code. I have checked the apache error_log and it tells me that PHP is configured, which i thought meant it was ok. Code:
View Replies !
Displays A Word For Two Months Before Changing It
I need a piece of code that displays a word for two months before changing it. So, if we are in September and October the word 'Apple' is displayed and if we are in November and December then the word 'Orange' etc. In all, there are 6 pairs of months, so six words. On the first of the first month, the word changes to the word for that pair of months. I think this might have something to do with arrays but I'm not sure.
View Replies !
Takes The Rating And Displays A Corresponding Image.
I'm making a site where people can make posts which are then rated 1-5. I want to write a php code that takes the rating and displays a corresponding image. I have written this: function ratingImage($overallrating) { if ($overallrating == 0){ echo "<img src="images atingzero.jpg">"; } elseif ($overallrating == 1){ echo "<img src="images atingone.jpg">"; } elseif ($overallrating == 2){ echo "<img src="images atingtwo.jpg">"; } elseif ($overallrating == 3){ echo "<img src="images atingthree.jpg">"; } elseif ($overallrating == 4){ echo "<img src="images atingfour.jpg">"; } elseif ($overallrating == 5){ echo "<img src="images atingfive.jpg">"; }} echo ratingImage($overallrating); This codes works perfectly in safari, but when I view the page in firefox or netscape navigator, the images do not appear. Can anyone think of why this code would not work in these two browsers?
View Replies !
How Can I Track Banner Displays On Another Site.
Hopefully someone can clue me into a solution (coding) to create a banner url that I can post on another site to track the number of times the banner is Displayed on that site. Its pretty straight forward tracking 'clicks' and visitors as the hyperlink can be set up to count track and record visitors easily.. Question is.. what if the do NOT click on the link? I want to know if the banner link I posted is actually being viewed as many times as I am told they are... Same thing would apply to a banner exchange.. How do I know if my banner is being viewed on the other site. Any suggestions on how I can build a link that displays the banners on another site and allows me to record how many times the banner was displayed?
View Replies !
Order By - Displays Numbers Before Letters
I have a database query that retuens the results correctly, but i need to do an order by clause. When i do this it displays numbers before letters, whereas i need to display letters then number e.g Jobcard No Page No. PRE001 page 1 PRE002 page 1 POS001 page 1 POS001 page 2 POS002 page 1 455101 page 1 455101 page 2 455101 page 3 567070 page 1 etc, etc, etc, the field Jobcard No. is a Varchar i think i need to changed to asci and Order By that way.
View Replies !
PHP Script That Displays Another Page Partial Content
If you go to http://europe.nokia.com/A4305060, fill the "Enter your product code:" field with the value "0523183" and press "Go" (the ending page URL varies because there's a variable session-ID in the URL-link associated to "Go") you will obtain this string: "Version: RM43_V1.10.030" Is it possible to have a string.php page that just display this string?
View Replies !
Hitting The Back Button Displays Last Search
I have a website where people can perform searches. Once they find what they're looking for they can click the link and get more details on an item. The problem I'm having is that people read the details and then hit the back button. Here they get a message warning them how the browser needs to resubmit the data that was entered in the search form or they're sent back to the search page. How can I cache the search terms or search results so if the person hits the back button they get the results of the previous search and not a message or are not sent back to the search page?
View Replies !
Get The Mysql Timestamp Converted To The Way Time() Displays It
I have a field in a mySQL table that is defined as timestamp. It auto updates itself whenever I do an update on the record. I want to be able to take the current time and compare it to the time in the record, and find out how much of a time difference exsits between the two in hours, mins, secs. I'm currently using time() to get the current time, but it seems that the time returns things in a different format then timestamp stores in. If I can get the mysql timestamp converted to the way time() displays it, then I'd assume I could just do some division as the time() is in the # of seconds from some date in the 70s.. correct?
View Replies !
PHP Displays Parsing Error And Line Number
I know I got syntax error some where. But php simply say "Errors parsing esearch.php". It does not display line number or any kind of hint. I've also set the error reporting to display all error and E_PARSE in ph.ini I am using php 5.2 and command line to run.
View Replies !
MCrypt (Decrypt) Displays Null Characters
When I use decrypt from MCrypt, in firefox, it displays a bunch of null characters at the end of my string. I've checked my records, and the strings are encrypted properly, so I am not sure why it is adding a series of nulls at the end of the string. e.g. String is "hello" Encrypts fine. When I decrypt it, it shows "hello[][][][][][][][][][][]" where [] is the null character. Is there anyway to remove the null characters at the end of any decrypted string?
View Replies !
Maths :: Displays A Number That Is Rounded To Two Digits
I am having a little trouble. I have a php form that does some math, then displays a number that is rounded to two digits (x.xx) using this code. <?php printf ("%5.2f", $numbertoberounded); ?> That part works fine, where I am running into trouble is when I try to store the rounded number in a new variable. Trying to figure it out on my own I tried <?php $newvariable = ("%5.2f", $numbertoberounded); ?>
View Replies !
Displays 5 Posts Per Page In Descending Order
I have been doing up a website which will, among other things, display news that I input into the MYSQL database. I have a working version of this where it just displays 5 posts per page in descending order (the latest at the top of the page) with the page numbering underneath them. Now what I wan't to do is just dispaly the latest 5 posts on the page but, I want to dispaly them so that I can put in a Javascript function to maxamize and minimize each post by clicking on the title. So, I have, ID, Title, Newstype, Author, Post, Date. In my mind I see this as display each of these using the COUNT(*) thing and just subtracting 1, 2, 3, 4 to get the 5 posts I want. I just don't know how to do it.
View Replies !
Developing A Page That Displays Latest 5 Images In A Database
I am currently changing my web site so that it is PHP and mySQL powered. On the front page I have an area that will display the latest images in my portfolio and the latest text description. Therefore, what I need is an admin page which allows me to upload images to a database which has a timestamp/date field, a thumbnail field, an image field, a text field for the title and a text field for the description. I also need a HTML form with inputs for the thumbnail upload, image upload, title and text description (in a textarea). It would also be useful to have the page display the database contents and allow me to edit the details and also, delete rows. I then need code for that will display the most recent 5 thumbnails and the title on my index.php page.
View Replies !
Displays Email Addresses On The Screen And Saves Them To A File.
I have the following code that displays email addresses on the screen and saves them to a file. The problem is, depending on what flag I put for $fp, it either doesn't write or if it does it doesn't overwrite what's there, just appends it. What can I do about this? Also, on the screen, it displays each record followed by a <br>. In the file, it just displays all the email addresses in a big block. PHP Code:
View Replies !
Creating A Form That Once Submitted Displays A Tabled Output
I have a form that I am trying to create that ideally will present a desired output based on the selections of the form. The following is an example of the dataset I am pulling from: I am trying to: 1. Have a drop-down selectable to select a start date. 2. Have another drop-down selectable to select a stop date. 3. Have radio buttons to select which datas I wish to view for the range set by steps 1 and 2. Example is nodes_available, nodes busy, one, both, or all. 4. Have the ability to select the interval of minute, hour, or day. Once the form variables are selected, then it is submitted with the desired results displayed in a table on another page. Ideally this output will eventually find its output displayed in some type of graph form, but at the moment I am trying to atleast achieve the desired outcome.
View Replies !
Displays Page Will Not Parse Till The Sql Query Is Finished.
I had PHP 4.3.3 running before I updated. When a page was loading, all the php/html that was doing simple prints of tables and images would load while an sql query was running. When the sql finished, the rest of the page displayed. I have now updated to 5.2.3 and when I go to the exact same page, nothing displays until the sql has completely finished. The issue with this whole thing is the javascript I had loading on certain pages that displayed an image telling the visitor "please wait, processing..". This no longer displays since the page will not parse till the sql query is finished.
View Replies !
MySQL Query - Page Which Displays A List Of Orders
At the moment I have a page which displays a list of orders, with the following query: Code: <?php mysql_select_db($database_connOriental, $connOriental); $query_rsOrders = "SELECT *, date_format(OrderDate, '%d %M %Y') as formatted_date FROM Orders INNER JOIN Customers WHERE OrderCustomerID = CustomerID ORDER BY OrderID ASC"; $rsOrders = mysql_query($query_rsOrders, $connOriental) or die(mysql_error()); $row_rsOrders = mysql_fetch_assoc($rsOrders); $totalRows_rsOrders = mysql_num_rows($rsOrders); ?> .........
View Replies !
Adjusting Time Displays For User's Local Time
I have a news/comment site where stories and comments are accompanied by the date they were posted. Currently I'm doing that in the GMT format, simply because it's easiest. What I'd like to do, however, is have the page display posts and comments with "your time," i.e., the local time of the user (example of what I'm talking about here). I know how to get local time variables from a user with javascript, but I'm not sure how to pass that information to PHP, especially since I'd like to do this on the front page, which means no passing javascript information via query strings.
View Replies !
HTML Email Using PHP Problem (Receive Html Tags)
When I send the html email, the only thing I receive is the tags (the html codes basically). I want to be able to see the email like a html page, what is wrong with my code? Here is a copy paste of it. $HTML = "</html><body><img src='http://www.somewebsite.com/ someimage.jpg'></body></html>"; $headers = "From: $from "; $headers .= "MIME-Version: 1.0 "; $boundary = uniqid("HTMLDEMO"); // Now we attach the HTML version $headers .= "--$boundary ". "Content-Type: text/html; charset=ISO-8859-1 ". "Content-Transfer-Encoding: base64 "; $headers .= chunk_split(base64_encode($HTML)); mail($to,$subject,"",$headers); print "mail Sent<br>"; The email I receive has this as text: </html><body><img src='http://www.somewebsite.com/someimage.jpg'></ body></html>
View Replies !
RemoveHandler .html .htm (parse Php In .html Files)
I want to parse php in .html files. I put this in .htacces file: RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html Its work, but some of my php aplications have urls: www.mysite.com/this-is-page without .html in the end how to parse that? Which code I must use.
View Replies !
|