matak
Jan 5 2007, 09:42 AM
I used this piece of code for my "dynamic" menu CODE <? $content = $_REQUEST['content']; if($content == "") { $content = "home"; $menur = "menur"; } ?>
Thx to a local Saint around here  Ok, when i arranged other stuffz like hrefs and other, as stated in tutorial here, that if function if ($content =="") is necessery for page to load content if server requests just plain index.php Now when i uploaded it HERE it doesn't show errors and works fine, but just beacouse display_errors in php.ini on trap17 hosting is set to Off, on my localhost it displays this error Notice: Undefined index: content in \htdocs\IHB-InternetHouse\index.php on line 2 but loads page normaly.. I tried this solution I created .htaccess file with directory index different DirectoryIndex index.php?content=home&menur=menur index.php index.html where content=home&menur=menur so that server automaticly searches for those pages... Now, a thought came to my mind, as i already set server to request for default home and menur, i deleted these lines from code CODE if($content == "") { $content = "home"; $menur = "menur";
And everything is working just fine... I'm asking you PHP Pros is this the right way to solve this "error" or is there a "smarter" way to it...
Comment/Reply (w/o sign-up)
Yacoby
Jan 5 2007, 01:24 PM
There are other people who know significantly more about PHP that me, but I don't think that that is a real error. I think it is something to do with the fact that $content isn't set when $_REQUEST['content'] isn't set, so when you check it against "" it pulls up a warning You could try CODE $content = $_REQUEST['content']; if ( !isset($content) ) { $content = "home"; $menur = "menur"; }
or CODE $content = $_REQUEST['content']; if ( !isset($_REQUEST['content'] ) ) { $content = "home"; $menur = "menur"; }
or something like that *shrugs* Someone else has probably got some better ideas
Comment/Reply (w/o sign-up)
jlhaslip
Jan 5 2007, 03:23 PM
CODE if ( !isset($_REQUEST['content']) ) { $content = "home"; $menur = "menur"; } else { $content = $_REQUEST['content']; }\
try this, maybe.
Comment/Reply (w/o sign-up)
matak
Jan 5 2007, 04:26 PM
tried all 3 solutions.. sorry yacoby, your 2 still shows errors. jlhaslip solution works, now it doesn't display any errors!! thanks for that!
Comment/Reply (w/o sign-up)
jlhaslip
Jan 5 2007, 04:51 PM
Glad that it works. Happy to have helped. That is the best part about hanging around here, there is always another pair of eyes to have a look at what you are doing and assist with getting it done.
Comment/Reply (w/o sign-up)
matak
Jan 5 2007, 08:16 PM
QUOTE(jlhaslip @ Jan 5 2007, 05:51 PM)  Glad that it works. Happy to have helped. That is the best part about hanging around here, there is always another pair of eyes to have a look at what you are doing and assist with getting it done.  Yeah!! Trap17 has some great members which are always willing to help! I really like that 'bout this site. Not to mention hosting, i wonder which computers and connection do they use, couse it's great and stable hosting! And maybe there should be subforum called "Errors" in which users could report errors when they try to code something, so that it doesn't mess with normal solutions.. But that's just an idea.. After i uploaded this guestbook i found, which works fine now i'm up to installing simple CMS (also found). So be sure i'll post more errors soon
Comment/Reply (w/o sign-up)
Similar Topics
Keywords :
- Getting Php Error On Oscommerce
(3)
Linux/ Apache /mod_rewrite Issue
Error when accessing a file (4) running on Ubuntu 8.04 with an XAMPP - php5.2.5, Apache 2., etc Getting this error when I try to
access an sNews CMS which requires mod_rewrite and is installed locally: QUOTE Apache/2.2.8
(Unix) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8e PHP/5.2.5 mod_apreq2-20051231/2.6.0 mod_perl/2.0.2
Perl/v5.10.0 configured -- resuming normal operations /opt/lampp/htdocs/jim/snews/.htaccess:
RewriteBase: argument is not a valid URL /opt/lampp/htdocs/jim/snews/.htaccess: RewriteBase:
argument is not a valid URL Using this link: http://localhost/jim/snews/snews16_ema....
Mysql Error
(3) ok i need some more help from the wonderful coders here at Trap. I'm almost done with my CMS
script, but i'm having a problem with the installer.php file, when it trys to inseret the user
data into the database i keep getting the following error: CODE mySQL Error: You have an error
in your SQL syntax; check the manual that corresponds to your MySQL server version for the right
syntax to use near ';INSERT INTO `members` (`id`, `name`, `username`, `password`, `email`,
`title`) ' at line 1 the code that is being excuted by the php file is this: C....
Php Objects: Catchable Fatal Error
There is a weird problem with objects in php 5.2.2 (4) in php 4.4.7 my code seems to be ok but in later version 5.2.2 i get this error Catchable fatal
error: Object of class mission_rank could not be converted to string in
/Applications/xampp/xamppfiles/htdocs/nexus/includes/forms/cn_reload.php on line 41 cn_reload.php
include('../class/userClass.php'); session_start(); $app_user =& $_SESSION ; if
($app_user->character != false) { $race_letter =
array('H','E','T','M','G'); $cn_id = 0; foreach
($app_user->character as $character) { // div container ....
T_string Error Please Assist
(5) I have unexpected t_strings in 3 lines they are CODE // $Header$ //this script may only be
included - so its better to die if called directly. if (strpos($_SERVER ,basename(__FILE__)) !==
false) { header("location: index.php"); exit; } /* A basic library to handle a cache of some
Tiki Objects, usage is simple and feel free to improve it */ class Cachelib { var $folder;
function Cachelib() { global $tikidomain; $this->folder = "temp/cache"; if
($tikidomain) { $this->folder.= "/$tikidomain"; } if(!is_dir(....
Phpbb2 Error
recently showing up (4) I tried to install a mod. Did it successfully but didn't like the end result. So I went through
the install backwards and reverted everything back to how they were. Now I am getting this error.
QUOTE Warning: Cannot modify header information - headers already sent by (output started at
/home/damen/public_html/phpBB/language/lang_english/lang_main.php:1034) in
/home/damen/public_html/phpBB/includes/page_header.php on line 483 Warning: Cannot modify header
information - headers already sent by (output started at
/home/damen/public_html/phpBB/language/lang_english....
Php Fsockopen() Error
(14) Hi guys, I've been having problems with PHP and my Apache server, I've got this book (SAMS
PHP, MYSQL and Apache All in One) I've installed all services correctly, but I get an error on
my Radio Homepage saying: QUOTE Warning: fsockopen() : unable to connect to 5.106.1.74:8000 (A
non-blocking socket operation could not be completed immediately. ) in C:\Program Files\Apache
Group\Apache2\htdocs\radio\stats\radio_stats.php on line 13 Riphabbo Radio Is Currently Offline
I'm new to PHP and would like to know if there is any way to stop this happeni....
Error On Emailer.php & Smtp.php At Phpbb
ERROR on emailer.php & smtp.php at PhpBB (2) Are you use free webhosting??? smtp.php and emailer.php are general error on CMS like phpBB . It
make email verification disabled.Why??? because free webhosting not allow us use smtp port .they
afraid their server will atacking with spam !! so what solution to solve this problem?? You can
search on google or join at phpBB forum !!! but if it can not solve all this problem it only able 1
trick ..you must download emailer MOD at www.phpbbhacks.com to inactive emailer.php or smtp.php ....
Error With Joomla Template
cant find function (1) Hello! I am working on my template in Dreamweaver and i am using joomla extensions for dreamweaver!
When i start my page with joomla stand alone server(jsas) i get this errors on the bottom of the
page! QUOTE Warning: mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed
to open stream: No such file or directory in w:\www\Joomla\includes\frontend.php on line 66
Warning: mosloadcomponent(w:/www/Joomla/components/com_banner/banner.php) : failed to open stream:
No such file or directory in w:\www\Joomla\includes\frontend.php on line 66 Warning: m....
[forum] Double Posting Happening By An Error
(3) Hello, I am currently working on EvilBoard 0.1.1, for those who know about this project versjon 0.1b
can be downloaded from http://www.evilservices.com Well over to the reason why i am posting this,
I am currently experincing a problem with my new posting code wich has been rewrited in version
0.1.1, You see, it is double posting by an error, i thouht i could fix that myself, but no, so i
just thought, Trap17 is perfect, they problety know how to fix this, Here is the code: CODE /*
* @Name: Post Topic * @Author: Arne-Christian Blystad * @Copyright: Copyright 200....
[^] Need Help With Regex (for .htaccess)
(2) Well, I ran into a problem. I tried to make a code that matched everything, except strings
containing the word "php", "gif", "jpg" etc. I tried doing something like this, but it didn't
work: CODE ( +)$ But that works just like if I would do this: CODE ( +)$ That code
is a part of a larger code that only works partially: CODE RewriteEngine on RewriteRule (
+)$ item.php?n=$1 Some strings, such as asd works, but fgh doesn't work. Any help
for either of these problems would be greatly appreciated! As you might see, I'm no maste....
.htaccess-style Login System And Php
(13) I am trying to make a login system that looks and works like .htaccess using sessions, with a PHP
script that detects the username used. Let's say I log on with the username "Amezis" and
correct password. Then I want a PHP (or any other kind of script) to create a cookie or session
which stores the user name, so it could be possible to store it in a variable as long as the user is
logged in, and so it can be printed when needed. Basically, this is what I want the script to do:
CODE /* This file can only be executed after logging in with the htaccess-style login....
Error Importing Sql Query Via Php
Works in PHPmyAdmin (6) CODE function sql() { $fp = fopen("sql.sql","r"); $sql =
fread($fp,filesize("sql.sql")); fclose($fp); return $sql; } Thats
$this->sql and here is the other source CODE function insert_sql() { if($_GET ) {
$template = new template; $db = new db; $db->connect(); $query =
$this->sql(); $query = $db->query($query) or die("Error!: " . mysql_error());
return $query; $return = " Create User
....
Help Needed With Silly Error
(8) Hi i have made a stupid error on one of my pages and having trouble finding it. It says unexpected
')' on line 114 can anyone please help me find it? Here is the page: CODE /** * *
@package TibiaME Clan/Download Site * @version 1.00 2006/09/27 00:04:37 wappy * @copyright
(c)2004-2006 wappyCULT * @home http://hack.s-60.org * @license You can use/modify this script but
distributing it without permisinn, or removing the "Script By: wappy" link will invalidate your
license and give wappy (wappyCULT) FULL RIGHTS to request removal of the script from your server....
Detect Image Resolution Without Gd
Also stop error if not found (1) Hi, I have come accross some starnge problem in PHP. I wanted to detect the image resolution in
of a URL specified by the user. This is possible via getimagesize() function of PHP that is
independent of GD library. But this function generates a E_WARNING Error if the image is not there.
What shall i do to stop this warning ?? I dont want to show the Error in PHP style but my style of
error reporting. Please help me.....
Uglymonkey Toplist Script
Getting an error with this script, please help. (7) I'm getting an error on the index page.Need help to fix it please. There's the error:
CODE Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in
/home/chatz/public_html/top/index.php on line 10 Failed: delete from uglymonkey_toplist where lastin
Here's the index page that I'm getting the error on: CODE include("config.php");
if ($purgedays>0){ $purgeseconds = $purgedays * 86400; $olddate = strftime("%Y-%m-%d
%H:%M:%S", time() - $purgeseconds); $getid = mysql_query("SELECT * FROM uglymonkey_to....
Freetype, Gd And An Error
I just can't get FreeType to work (1) Basically I have this code: CODE header("Content-type: image/png"); $bgimg = "bg.png"; $im =
imagecreatefrompng($bgimg); $number = rand(10,99); $textcolour = imagecolorallocate($im, 255, 255,
255); $font = "arial.ttf"; imagettftext($im, 65, 0, 5, 95, $textcolour, $font, $number);
imagepng($im); imagedestroy($im); Unfortunately all I get is the blank placeholder for an image
(or the red X if you still use IE) rather than my actual image. I have honed the problem down to the
imagettftext line, as I have tried replacing it with imagestring and it works OK. I ....
Php Form Help!
Parse error T_LNUMBER - expecting T_VARIABLE (3) Hello, I am trying to make an employee application. I was just wondering if anyone knows how to spot
a php code error, when the code directly around the line with the error looks the same. below is
some of my process.php code. I beleive the error is on line 41. QUOTE PHP parse error: PHP
Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in
/home/wwwange/public_html/FORMS/forms/process.php on line 41 Process.php code: CODE
include("global.inc.php"); $errors=0; $error="The following errors occured while processing your f....
Php Error When Running Script
Php error when running script (3) Hello, I get the following error: Parse error: syntax error, unexpected T_STRING in
/usr/local/psa/home/vhosts/club-amigos.co.uk/httpdocs/contact.php on line 44 when l run the
following script: Any help would be appreciated. CODE /* PHP Form Mailer - phpFormMailer
v2.1, last updated 30th Nov 2005 - check back often for updates! (easy to use and more secure than
many cgi form mailers) FREE from: www.TheDemoSite.co.uk Should work fine on most Unix/Linux
platforms */ // ------- three variables you MUST change below
---------------------------------------....
Suppressing Mysql Error In Php
How to suppress auto generated mysql err (4) I am testing my website on my local machine. It is still in development stage and I am using
php/mysql. If there is a mysql connection error, I am checking for the connection variable and
displaying a proper error message. But even before it displays my error message, it displays an
error message on browser thrown by mysql (MySQL Connection Failed: Access denied for user). Can I
suppress this message and display only my message?....
Parse: Error Unexpected T_lnumber
php parse error when running script (4) Hi. I've just created a php script. The main object of the script is to delete some old files
and replace it with a new file with some new content, effectively moving the contents from one file
to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) { $a_B++; }
$new_page_contents = " " . $_POST . " " . $_POST . " include
\"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen($a_B . ".cmat", "w+");
fwri....
Parse Error
unexpected $ (1) i have this code CODE if($_POST =="" or $_POST =="" or $_POST =="" or $_POST =="" or
!isset($_POST )){ print(' '); print('FTP username '); print('FTP
password '); print('FTP Host '); print('FTP Root Directory ');
print(' '); print(' '); }else{ $ftp_server = $_POST ; $ftp_user = $_POST ;
$ftp_pass = $_POST ; $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to
$ftp_server please refresh and do not click retry"); // try to login if (@ftp_login($conn_id,
$ftp_user, $ftp_pass....
Phpbb Install Error
help w/ phpbb plz.... (2) ok, i type in eveything that phpbbb asked to install, and i use the info i got in the mail and made
a db, but it doesn't work at all.......instaed it says "An error occurred trying to update the
database You have an error in your SQL syntax; check the manual that corresponds to your MySQL
server version for the right syntax to use near ''' at line 1" what does this mean and
how do i fix this and install the forum?? i have tried to install this many times now but it never
works /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> ......
.htaccess Redirect Question
redirect ALL traffic to another domain (6) I want to redirect all my traffic from one site to another domain name. Is this possible, and if so,
would I do something like this: .htaccess code: CODE redirect 302 / http://www.mynewdomain.com
Thanks!....
Validation Error No Insert
(3) im having some trouble with this PHP Code: CODE while ($checking = mysql_fetch_array($check)){
$usr = $checking ; $mail = $checking ;
$error = ""; if ($mail == $email){
$erroremail = "the email address you have chose is already taken";
$error = 1; } if ($usr == $user) {
$errorusername = 'the username you have chosen is already taken....
Weird Error Messages In Opera
(2) On the bottom of my site, I get weird error messages, but only in Opera (Not firefox or IE). The
messages appears below the last include tag on my site, so they appear on the bottom of the page. I
get two different messages: QUOTE ETag: "9e80b2- HTTP/1Date: Fri, 02 Sep 2005 11:48:28 GMT
Server: Apache/2.0.52 (Unix) Connection: Keep-Alive Keep-Alive: timeout=1, max=98 ETag:
"4b94ff-40c5-98ed0bc0" HTTP/1.1 200 OK Date: Fri, 02 Sep 2005 11:48:28 GMT Server: Apache/2.0.52
(Unix) Last-Modified: Fri, 02 Sep 2005 11:48:26 GMT ETag: "4b9516-1be2-8a1f9680" Accept-Ranges: by....
Error When Using file_put_contents()
failed to call to undefined function (5) Hey all, I decided to write a script which writes some text to a file, but I have a problem when I
execute the script, I get a fatal error: QUOTE(homepage) Fatal error : Call to undefined
function: file_put_contents() in /home/cmatcme/public_html/afile.php on line 55 This is the
code I'm using to write the file: $ipfnsdoc = "/home/cmatcme/public_html/afolder/afile.txt";
if (!is_readable($ipfnsdoc)) { echo "File cannot be read"; $stopload = 1; } if
(!is_writable($ipfnsdoc)) { echo " \nFile cannot be written to"; $stoploa....
Fatal Error
something about [] and strings (3) I have this variable that I want to take the value of to use as an array, now it is a slightly odd
variable it's one that I get by combinin a word and a number and then calling the information
stored in that var, so ${${word . $number}}, anywho I get the following error Fatal error:
operator not supported for strings in and then the path....
Php Parse Error
Including Variable in post (2) ok this is my config script that runs my site: CODE # Set up info for left column on the top
page: # It should begin with html tag and finish with tag $top_leftcol="
MMORPG Trade Center Welcome to MMORPG Trade Center. Please post your in game item only
in the correct game section. News News Goes Here
Other Other Links Goes Here "; ?> acutally i didnt
write this but heres my problem CODE News Goes Here where is says "News....
Trouble With Emailer.php
failed sending email error (6) Whenever someone registers at my forum, they get this error: Failed sending email :: PHP :: DEBUG
MODE Line : 234 File : emailer.php however, the account will be sucessfully registered. It is
weird because i did not change the original emailer.php at all. O__O||| anyone know whats up with
it?....
Looking for Php, Error, .htaccess, Solution
|
Searching Video's for Php, Error, .htaccess, Solution
See Also,
|
advertisement
|
|