FastTemplate Errors
I'm attempting to use the PHP FastTemplate class, and am running into trouble right away. I'm using the latest version of the template code, and PHP 4.0.6. Code:
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
FastTemplate
I'm trying out FastTemplate now, but there is something weird going on. In the templates i'm using {TITLE} as a variable. In my understanding this should be the right way to do this. BUT, if i parse the templates, it has only replaces TITLE and not the {}... so i get something like: {Welcome to my site}.
FastTemplate
I am trying to get my feet wet with PHP, however I am falling into some trouble. The trouble I am experiencing is with FastTemplate. I am getting the error message: Fatal error: Cannot redeclare FastTemplate::clear_parse() in ..... The (...) is pointing to the FastTemplate.php file. I am using PHP4. I was wondering if anyone has experienced this error message. I have looked all over the internet for the solution.
FastTemplate Error Clear_parse()
Fatal error: Cannot redeclare clear_parse() in /usr/local/php/lib/php/class.FastTemplate.php on line 638 has anyone seen this error and do you know what is causing it?
FastTemplate - Strange Problem
I have just uploaded page based on FastTemplate to my virtual server. Page generate data from MySQL base. Everythink is OK on my and several my friend's machines. But one of my friend has error on te same www: [DTemplate] Warning: no value found for variable: {VARIABLE}. Why? How is it possible? The same version of browsers. I thought that code is generated at server-side; the same results for all of the users but not :(
My FastTemplate Is Duplicating Content
I'm having a problem with Fast Template duplicating the content. Here's the code, hoping someone may be of help, thanks! while(list($last_name)=mysql_fetch_array($data1)) { $data2 = mysql_query("select first_name from user where last_name='$last_name' "); while(list($first_name)=mysql_fetch_array($data2)) { $tpl->assign("FIRST_NAME", $first_name); $tpl->assign("LAST_NAME", $last_name); $tpl->parse(USERS, ".list"); $tpl->clear_tpl("list"); } $tpl->parse(VIEW_ALL, ".list_all"); $tpl->clear_tpl("list_all"); } now when the first "while" passes to the next last name, for example "jimenez, the second "whie" looks for users that have the last name of jimenez. now heres the problem, when it shows the result in the browser it should show nothing more than the last search, however it also shows the search before that one plus a copy of it!!! and so on, it carries on the searches!! besides it has a command that when it goes through once it clears the memory or that variable so it wont carry it on to the next with option clear_tpl, but it shows it anyways!! (what shows in the browser) (1 gone through) garcia walter garcia quique garcia ramon ........... (2 gone through) garcia walter garcia quique garcia ramon ........... jimenez pepe jimenes carlito ...............
Supress Errors At The Page Level? Undefined Index Errors.
I'm creating a simple reply form, and if a form item isn't answered I get an error: "Notice: Undefined index: rb_amntspent in c:inetpubwwwrootmackinawsurvey.php on line 36" even if in the code I allow for an unselected item. (Code at the bottom here.) It works fine otherwise. Now in the past I've made a change to php.ini to repress errors, but for this project I don't have access to the php.ini. Is there a way to supress errors on that page for that session? Or, is there a way to just not get that error at all? Here's a sample of the code that gets the form response. If an item is selected, no error for that question, but if an item is not selected I get the error above even though I still get a successful echo for the "else" or "default" option which occurs if nothing is selected: $rb_visited = $_POST["rb_visited"]; //Have you ever visited Mackinaw City, Michigan? if ($rb_visited == "1") { $rb_visited_reply = "Yes"; } elseif ($rb_visited == "0") { $rb_visited_reply = "No"; } else { $rb_visited_reply = "You did not answer this question"; }; $rb_lastvisit = $_POST["rb_lastvisit"]; //When was your last visit to Mackinaw ity? switch ($rb_lastvisit) { case "1": $rb_lastvisit_reply = "Earlier this year (2003)"; break; case "2": $rb_lastvisit_reply = "Last year (2002)"; break; case "3": $rb_lastvisit_reply = "2 years ago (2001)"; break; case "4": $rb_lastvisit_reply = "3 years ago (2000)"; break; case "5": $rb_lastvisit_reply = "4 or more years ago (1999)"; break; default: $rb_lastvisit_reply = "You did not answer this uestion"; }
Fasttemplate Files Stored In Multiple Directories
If I declare in the script $tpl = new FastTemplate("/tmpl"); then I can use only template files in tmpl directory. What if I want to use template files in another directory in the same script? such as header.tpl and footer.tpl that are in another directory?
Errors In Php 5.0.4 Not In 4.3.10-16
I use the following statements: $var = ""; $var = $_POST('varname'); In php 4, when 'varname' was not defined, $var remained an empty string; In php 5, I suddenly get errors. I solved these by including the function array_key_exist to check the occurence of 'varname' Is this the prefered way or is ther a better solution?
Errors In Php 5.0.4 Not In 4.3.10-16
I use the following statements: $var = ""; $var = $_POST('varname'); In php 4, when 'varname' was not defined, $var remained an empty string; In php 5, I suddenly get errors. I solved these by including the function array_key_exist to check the occurence of 'varname' Is this the prefered way or is ther a better solution?
PHP 404 Errors
Some of my visitors keep emailing me about "404 page errors" on my website even though the pages are working perfectly. I have had this problem before , I figured it out and it was because of my "generators" which uses pure PHP codings like this - http://www.generators.hot-lyts.com/linkgen.php. I had the solution, I made a sub domain and since then I wasn't getting anymore error mails however it occurs again, I have checked the new pages I've added recently and deleted some of them but I still have no luck, I still get tons of mails about this error pages and it is really frustrating because my hits have been dropping big time. I really have no idea what the problem is with my website. I am not sure if it's my server or some php problems. Code:
Connection Errors ?
host -{ The server }- is blocked because of many connection errors. Unblock with 'mysqladmin flush-hosts' anyone know why this message show up allot of times and goes away only after restarting mysql and apache ? is there a other way if fixing this ?
Odbc Errors
I am using php and sybase as a backend. To connect to sybase I am using odbc connections. the odbc connection is working fine but when I run an sql statement i get the following error: " Warning: Supplied argument is not a valid ODBC-Link resource " I am using an external file which holds my connection function which is: function db_connect() { global $dbhost, $dbusername, $dbuserpassword, $defaultdbname, $dsn; $myConnection = odbc_connect($dsn, $dbusername, $dbuserpassword) or die("Unable to connect to Server"); } $myConnection = db_connect(); echo "Connected"; $mySql = "Select * from branch"; $myResult = odbc_prepare($myConnection, $mySql) or die("Could not prepare Statement"); odbc_execute($myResult) or die("Could not execute Statement"); odbc_free_result($myResult); odbc_close($myConnection); I get an error after the sql query. Can anyone please tell me what's wrong with this?
PHP Install Errors
I want to install Twig for web email which requires apache and php so I've installed all the right stuff but it still fails. Error_log output: [Fri Feb 16 11:57:07 2001] [info] Server built: Feb 15 2001 11:38:09 [Fri Feb 16 11:58:46 2001] [error] (8)Exec format error: exec of /var/www/htdocs/index.php3 failed [Fri Feb 16 11:58:46 2001] [error] [client 134.202.1.235] Premature end of script headers: /var/www/htdocs/index.php3 I configured Apache using the commandline: Code:
Bcompiler Errors
I am getting these errors all the time now, on multiple scripts at random times. Warning: bcompiler: Bad bytecode file format at 00000000 in Unknown on line 0 This tells me it has to be PHP in some fashion.
Display Errors Is Both On And Off
I have a website in which PHP errors are displayed, despite having them configured to not display. Here is a test file I created to explore this: <?php echo ini_get( 'display_errors' ); phpInfo(); ?> The ini_get says "On", the phpInfo says "Off" (for display_errors in the PHP Core section). PHP 5.0.4 I'm struggling to understand how, at runtime, I get these conflicting reports. The configuration files all say display_errors is OFF, and phpInfo agrees, but PHP acts like they are on, and ini_get shows why.
Displaying Errors
php_info(); for display_errors variable says: Off, Off. I tried the error_reporting(E_ALL);, but nothing happens. If I have an error somewhere, PHP just silently dies, no output whatsoever. Which variable has to be set so that error_reporting() function works, but no errors/warnings are displayed if the error_reporting() wasn't executed (admins don't want to have display_errors On globally)? PHP Version is 4.3.3. --
Trapping Errors
Is there a clean way to trap errors in PHP? In Perl there is eval { <code> } and a special variable that can be checked to see if the execution of the code was successful or not, and thus a clean way to trap the error without it killing the entire script. Is there something similar in PHP?
How Do I Get MySQL Errors?
I just started going from ASP to PHP about a week ago, and I'm absolutely loving it, but what is up with PHP and MySQL errors? When I insert data with a mysql_query() and nothing gets inserted, I have no way of knowing what went wrong. Where are the errors?
Errors Using Php And Perl
I'm trying to intergrate a cgi affiliate tracking system into a php website. When someone pays using PayPal it's supposed to direct them to one page if the payment is a success or another if payment failed. This is the code: if($action == order && $order_n != "") { include "engine/card_process.pml"; if($payment_status == success) { $page = payment_success; } else { $page = payment_failed; } } I'm trying to insert code into this process that will credit the affiliate the correct amount if the process is a success. This is the code that's supposed to be inserted to credit affiliates: <img src="http://www.yoursite.com/cgi-bin/affiliates/sale.cgi?payment= $amount" border=0> I tried inserting this before the line "$page = payment_success;" in various forms, but I either get errors, or the affiliate isn't credited, or both. I managed to get the code to credit affiliates correctly, by inserting this: include "<img src='http://www.yoursite.com/cgi-bin/affiliates/sale.cgi? payment=$amount' border=0>"; but it also gives me errors: Warning: main(): failed to open stream: No such file or directory in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18 Warning: main(): Failed opening '<img src='http://www.yoursite.com/cgi- bin/affiliates/sale.cgi?payment=0.01' border=0>' for inclusion (include_path='.:/usr/share/pear') in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 18 Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29 Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 29 Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/vhosts/yoursite.com/httpdocs/index.php:18) in /home/httpd/vhosts/yoursite.com/httpdocs/index.php on line 69 Line 18 is the inserted code, line 29 is: session_start(); Line 69 is: setcookie("current_page"' $page); If you can help me I would appreciate it. I really don't have a clue about what I'm doing. I'm just guessing. Also, the email address is valid. Address harvesters are programmed to ignore email addresses that contain the word "fake".
Errors With $_SESSION
the website i'm creating will block "guest" users to some sections of the site. when "guest users" go to "download" page it will show an alert window. logged in members have the access to download page. in "login.php", i create a $_SESSION var, each member has their own level, depending on the type of features they want; $_SESSION['mylevel'] = $member_info['level']; the checking of level to show the alert window is this: Code: if (($_SESSION[mylevel']=='')||($_SESSION['mylevel']==Ə')) { ?> <SCRIPT LANGUAGE=JavaScript> var agree=alert('Please login first.'); window.location='http://www.mywebsite.com' </SCRIPT><? } problem is like this; as a guest user, i go to "download" page, the alert window shows up, saying "please login first". (that's ok) when i log in, then go back to "download" page it still shows the alert window. i have to close the browser first then go to "download" page before its accessible.
WhereBisDu Errors
I have installed WhereBisDu on phpNuke 7.0 and it seems to work well. The problem I am encountering is when I scroll down to the bottom of the Forum page, I see these errors. I see no where in the php scripts where I need to put in SQL information. what am I missing: Quote: Warning: mysql_query(): Access denied for user: 'XXXXX@localhost' (Using password: NO) in /var/www/html/modules/WhereBisDu/wbdtrack.php on line 36 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /var/www/html/modules/WhereBisDu/wbdtrack.php on line 48 Warning: mysql_query(): Access denied for user: 'XXXXX@localhost' (Using password: NO) in /var/www/html/modules/WhereBisDu/wbdgeo.inc on line 188 Code:
No Errors ( Mysql )
<?php echo "a href="index.php?alp=a">A</a> ] " ."- [ <a href="index.php?alp=b">B</a> ] " ."- [ <a href="index.php?alp=c">C</a> ] "; if (isset($_GET['alp'])) { // Now what must i make the sql statment so that it will display all the names that starts with a $_GET['alp'] ( a ) // // and if i use like then it will display all names that has a 'a' some where in the word. // $sql = "SELECT * FROM store_items WHERE name = '$sid'"; $result = $db->sql_query($sql); while($row = $db->sql_fetchrow($result)) { $name = $row[name]; } } ?>
How To Get Errors From Exec?
I am running PHP 4 and this code is failing, in that it does not insert the records into MySQL // Upload the data to file to the db. exec("mysqlimport --replace --fields-terminated-by=',' --fields-optionally-enclosed-by='"' --user=$db_user --password=$db_password --host=$db_hostname --lines-terminated-by=' ' $db_name $new_src_file_path", $output, $return); Sadly, the $output array is empty, but the $return value is 127. Does anyone know what that means or how I can get more meaningful error output?
Phpgroupware On Iis Errors
i'm trying to install phpGroupWare on Win2k running IIS 5. I know i should be using Apache, but this is what my current conditions limit me to due to other projects and applications that have to be on IIS. I have been running into problems left and right. Lots of them were fixed with the php.ini fix of register_global = on . i am still getting tons of error and every single one is Undefined something or other. moslty Undefined index with a few Undefined properties, classes and functions sprinkled throughout. i'm hoping that the new verson of PHP had somethin done in the ini file, similar to the register_globals, that would change something about defining variables. If anybody has any insight,
Errors To Stderr
I want to write all produced error messages (error, warning, notify, etc...) to STDERR. Is this possible without writing my own error handling routine?
Socket Errors
I'm looking through a complex script at the moment. If the OS is FreeBSD, the script defines EINPROGRESS to error 36 (Operation now in progress), EALREADY to error 37 (Operation already in progress), and EISCONN to error 56 (Socket is already connected). If it's Linux, then sets them to 115, 114 and 106 respectively. I want to try and add Windows compatability to this code. I've printed a list of all Windows socket error codes from 0 to 15000, but can't find the similar errors,
Errors In Php/mySQL
I wonder if there is any command to hide php and mySQL errors from the user, and replace them with a customized message, en maybe even send a mail with the error to a defined email adress..
Fsockopen Errors
In the code fragment below $errno and $errstr get set to the system-level errno and strerror() from the connect() call. Does anyone know what the errors below mean an how I may rectify them? $fp = fsockopen($host, $port, $errno, $errstr, 30); Here are the resulting errors I get regardless of what I specify for $host: $errno = "115" $errstr = "Operation now in progress"
Session Errors
I've got a Php 4.3.3 installation on A Red Hat Advanced Server 2.1. Sessions start correctly if i start them from the server root. But, if i start the session on a sub-folder, when i change to a folder that's not below it, the session gets started again. Let's see an example When i begin from the document root all goes as expected... Open /index.php -> session id = A Open /folder1/index.php -> session id = A Open /folder2/index.php -> session id = A But when i begin on a subfolder....... Open /folder1/index.php -> session id = A Open /folder1/index2.php -> session id = A (inside the same folder the session is mantained) Open /folder1/subfolder/index.php -> session id = A (on a sub-folder the session is also mantained) Open /folder2/index.php -> session id = B (on a folder that's not below the first, the session starts again!!!!!!!!) Open /folder3/index.php -> session id = C It's like if the session were only set for the current path and downwards, but not the entire server... Any thoughts?
Mysql Errors
I've run a php script that uses mysql databases without problems on one server, but then I changed web hosts and installed it the same way buy I get a lot of errors which are all derived from the script not being able to interact with the database. It finds the database and connects, but then can't do anything else. When it uses a database on a different server, things work fine, so I'm guessing it's just a mysql error and not the fault of the script.
PHP Does Not Report Errors!
I have no idea how this happened, but PHP (5.1.2) on my dev server stopped telling me about errors. There's nothing in the server log either. I redownloaded PHP and used php.ini-recommended (only setting display_errors = On). After restarting, it still returned blank pages rather than error messages. So I deleted php.ini and restarted the server, and suddenly error reporting came alive! Where have I buggered up?
PHP Startup Errors
i'm using pHP 5.2.1 after much effort i've managed to get it to work in IIS and it can pull data out of mysql database that was installed with xampp. now the xampp has a php 4 in there - using that for other java/apache projects - cant remove it. thing is - when i start up my machine or i restart the IIS service, i'm getting a whole bunch of PHP Startup error message, mostly to do with not being able to load dynamic libraries. I've configure the php.ini file in terms of the ext etc, set up my environment variables etc.
Odd Forbidden Errors
Not sure if this is PHP or .htaccess errors but for some odd reasons certain rewritten URLs on my forum work, and others don't. They all work for me, but for some people they have reported "Forbidden" server errors. I'm stumped at what it could be. Example of a working URL Example of a "Forbidden" URL I have attached my .htaccess file's contents below in case it is being caused by it: Code:
Require_once() Errors
Im making a website and i am writing a php script for a register form. The script checks for required fields if a required field is missed out then a error is generated. I think the problem might be on the server site. There errors i am getting are Warning: require_once() [function.require-once]: open_basedir restriction in effect. File(/Connections/userlogin.php) is not within the allowed path(s): (/tmp:/usr/share/pear:/home/fhlinux169/m/maltmandarkblues.co.uk/user) in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2 Warning: require_once(/Connections/userlogin.php) [function.require-once]: failed to open stream: Operation not permitted in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2 Fatal error: require_once() [function.require]: Failed opening required '/Connections/userlogin.php' (include_path='.:/usr/share/pear-php5') in /home/fhlinux169/m/maltmandarkblues.co.uk/user/htdocs/Register.php on line 2 The code:
HIDE Errors?
I used a show error code once, can't remember which, but now I've looked at my site, every error on every page is showing, including undefined variable errors (partly because they're defined by forms on that page). So how do I hide all errors?
Session Errors
Im trying to call a session via session_start(); in a script, and im getting this error. Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/frozen/public_html/fg/index.php:8) in /home/frozen/public_html/fg/ses.php on line 11 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/frozen/public_html/fg/index.php:8) in /home/frozen/public_html/fg/ses.php on line 11 PHP version 4.4.6
Catching Errors?
I am having trouble wrapping my head around the general concept of catching errors. I have read the tutorials about exceptions on DevShed, as well as on Zend's website. It is still not clear to me. If I throw 5 exceptions, how come I need 5 catch phrases, and what does it mean when it travels up the stack? Sorry I am just really confused with the catch phrases and how they work, although I am almost positive I completely understand the throwing of exception concept.
Fatal Errors
I'm getting this rather ugly error when i try to use the same include more than once: Fatal error: Cannot redeclare resize_png_image() (previously declared in path/backup+.php:189) in path/backup2.php on line 189 Is there anything I can do to stop it happening? - I need to re-use this include anything up to 50 times on a page.
XAMPP Errors
I Installed XAMPP, and it doesn't display errors in my PHP, can you help me?
PHP Not Reporting Errors
Ive tried editing the .ini, and manually setting on run time. Here is a test script I whipped up to make it throw an error to see if it reports: <?php error_reporting(8191); echo "text" ?> Now it should obviously say compile error for the lack of a ;. But it dosnt. Any ideas why?
Sudden Session Errors
Is there any reason that you can think of why a script that was working fine up till recently would suddenly start throwing the following error? Fatal error: session_start(): Failed to initialize storage module. in /home/not/real/path/file.php on line 2 Like I said, it was working fine till yesterday. nothing has been changed in the file, nor in php.ini. It just stopped working. Any ideas?
Getting Wierd Query Errors.....
I'm a PHP newbie, but I'm teaching myself by writing some apps so I can get a feel for the language. I'm working on a user login/news posting system for my site, and for the login part I've been getting some wierd errors...... I go to the login page and it displays properly, but at the bottom of the page I get this: Warning: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /web/sites/220/atma/www.ffunlimited.f2s.com/admin/login.php on line 143 Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /web/sites/220/atma/www.ffunlimited.f2s.com/admin/login.php on line 143 Warning: MySQL: A link to the server could not be established in /web/sites/220/atma/www.ffunlimited.f2s.com/admin/login.php on line 143 Error! Could not query database! Warning: Supplied argument is not a valid MySQL result resource in /web/sites/220/atma/www.ffunlimited.f2s.com/admin/login.php on line 161 This is wierd because I already tested the login and it connects, selects, and executes using the database. Here's my code:
Hiding Mysql Errors
Occasionally (during a reboot, etc.) the mysql server is unavailable, and I wish to display something other than the mysql_connect error that I get now, along with an otherwise blank screen. I would prefer to display a custom error page that state's 'we are currently updating the database...yada, yada, yada...' I'm just really not certain where to put this custom html.
Warning/Fatal Errors
I get this on my page. Does that mean my database is not working? If anyone wants to see the database using my control panel I will gladly let you have a fiddle if you can help. Thanks. (btw i am using URL a content management system on my site which is where it is not working) Warning: main(language/lang-.php) [function.main]: failed to create stream: No such file or directory in /home/inme/public_html/mainfile.php on line 166 Warning: main() [function.main]: Failed opening 'language/lang-.php' for inclusion (include_path='') in /home/inme/public_html/mainfile.php on line 166 Warning: head(themes//theme.php) [function.head]: failed to create stream: No such file or directory in /home/inme/public_html/header.php on line 31 Warning: head() [function.head]: Failed opening 'themes//theme.php' for inclusion (include_path='') in /home/inme/public_html/header.php on line 31 Fatal error: Call to undefined function: themeheader() in /home/inme/public_html/header.php on line 47
Errors On PHP Build With LDAP
I am working on an OS X 10.1.2 box. I have complied OpenLDAP and it is working fine. I can compile PHP (tried 4.0.6 and 4.1.1) with LDAP using:
Multiple Connection Errors
I am facing multiple connection error in one site.This mean when mulitple users work simultaniously on any site that time some errors display. Can anybody tell me the solution of this type errors.
What Is The Best Way To Test For Parse Errors?
I'm thinking I'll write a script that loops through all the PHP files in a folder and does two tests, first to see if a file is there and then to see if it can be included(). If file_exists() is true and included() is false, there is probably a parse error in that file. I'll then have the script spit out a warning for me.
Php Login System Has Errors In IE6
I've recently created a login system for a client, using PHP and MySQL. The user enters info, it checks the password compared to a hash in the database, and creates a session (which is stored in the database, due to shared server) and lets them in if they match. For some reason, it doesn't work in Internet Explorer 6, only. It works in Firefox, IE7, Opera. Don't know about Safari yet. Now, I'm running the TredoSoft Multiple IE app that allows for standalone versions of Internet Explorer, so I tentatively think it might be an issue with that. However, I've never heard of those kind of issues arising from use of Multiple IE. I suppose the session could be creating a cookie, which would explain the error, but I haven't told it to do so. I also haven't heard of IE6 treating server-side generated code so differently, though. Has anyone had experience with IE doing this, or with Multiple IE specifically doing this? If it's a Multiple IE thing, I can ignore it, but if not I obviously need to revisit some things.
|