Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 03-17-2005, 02:42 PM   #1 (permalink)
Inactive
 
Join Date: 10-25-04
Posts: 12
iTrader: 0 / 0%
Latest Blog:
None

norskhostfest is liked by many
PHP problem

i have this php code included in several pages:

<?php
$template="Updates";
$number="10";
$category="13"; echo $template.$number.$category;
include "fork/show_news.php";
?>

sometimes it works, sometimes it doesn't. in the pages it doesn't work on, the code is duplicated above it several times, but called with different $template, $number, and $category values. when i comment out the $number variable in the scripts above, the code ends up working. any ideas?
norskhostfest is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-17-2005, 03:14 PM   #2 (permalink)
Inactive
 
littleFella's Avatar
 
Join Date: 06-20-04
Location: Ontario
Posts: 3,359
iTrader: 0 / 0%
Latest Blog:
None

littleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to beholdlittleFella is a splendid one to behold
why would $number and $category be declared as strings? Try declaring them as integers, which they seem to be anyway;
littleFella is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-17-2005, 03:49 PM   #3 (permalink)
Inactive
 
insitedev's Avatar
 
Join Date: 12-14-04
Posts: 108
iTrader: 0 / 0%
Latest Blog:
None

insitedev is liked by somebodyinsitedev is liked by somebodyinsitedev is liked by somebodyinsitedev is liked by somebody
what are the values of the variables on the pages that do not work? It is possible that something in those values is causing a problem (a " mark for instance).
insitedev is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-18-2005, 07:46 AM   #4 (permalink)
Inactive
 
Join Date: 10-25-04
Posts: 12
iTrader: 0 / 0%
Latest Blog:
None

norskhostfest is liked by many
i have to apologize for not being proficient at this. i've never looked at php until yesterday. i am forced to try and debug b/c my webdesigner has disappeared on me! anyways, imagine this being in a page (changing $number and $category to int from string makes no dif):

<! MODULE 1: in file music.php>
<?php $template="SOTM";
$number=1;
$category=17; include "fork/show_news.php"; ?>

<! MODULE 2: in file music.php>
<?php $template="Tues_Release";
$number=4;
$category=18;
include "fork/show_news.php"; ?>

<! MODULE 3: in footer.php, which is included in music.php>
<?php $template="Updates";
$number=10;
$category=13; include "fork/show_news.php"; ?>

that is the jist of the code. as above, module 1 & 2 both work while module 3 doesn't. if i comment out the $number line in module 2, then module 3 works, but the resulting text on the actual web browser looks fuzzy. if i comment out the $number line in modules 1 and 2, then module 3 works and looks correct in the browser. as soon as i uncomment the $number line in modules 1 and 2, module 3 stops working. i have also tried putting module 3 directly into music.php instead of including it as a footer but this does not change anything.
norskhostfest is offline  
Add Post to del.icio.us
Reply With Quote
Old 03-18-2005, 12:32 PM   #5 (permalink)
Inactive
 
TeKBuzz's Avatar
 
Join Date: 11-12-03
Location: Ohio
Posts: 558
iTrader: 0 / 0%
Latest Blog:
None

TeKBuzz is liked by somebodyTeKBuzz is liked by somebodyTeKBuzz is liked by somebodyTeKBuzz is liked by somebody
Send a message via ICQ to TeKBuzz Send a message via AIM to TeKBuzz Send a message via MSN to TeKBuzz Send a message via Yahoo to TeKBuzz
have you tried renaming the variables so they don't match? IE: make the footers $template_footer $number_footer or something so that its not trying to read different values from one variable?
TeKBuzz is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
where is the problem parabara Web Hosting Forum 11 09-23-2007 03:45 PM
Google's China Problem (and China's Google Problem) - NYTimes Sunday Mag (4/23/06) Julie Google Forum 3 09-18-2007 02:00 AM
Problem with godaddy. Post your problem here!! charlesgan Web Hosting Forum 7 05-09-2007 10:36 AM
CSS problem blelisa Web Design Lobby 4 03-05-2004 03:32 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 02:36 AM.
© Copyright 2008 V7 Inc