General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 7th, 2003, 07:22 PM
ricky158 ricky158 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 ricky158 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question blank variable interfering with other variables

i couldnt think of a better subject, so sorry in advance...


well, here's my problem. for my site, i'm just starting to use PHP for the first time. i have a bunch of html files and i'm using PHP to bond it all together. in my index.php file, i have a fat-assed list of variable/include codes so that it'll open up the file in that table data cell. a friend told me to include...

PHP Code:
if ($call=="") include("main.html");?> 


at the end of the list so if visitors are trying to go to the main site and they aren't typing in any variables, they go to the main page (main.html). but i have other variables besides "call." i have many of them, in fact. so when browsing around the site, i go to a page that doesnt have the call variable in it and it loads the main.html page below the page i want to see independantly in that table data cell.

my question is this: what can i do to the code so that the main page isnt loaded at the bottom of every page besides "call" pages?p; i really hope the only way around the problem isnt to go without all other variables besides "call" because that would throw off my entire organization with variables and sub-variables.

if you'd like to see an example of my problem (okay, it's not an example, it's the real problem) visit my site at URL and click around on the navigation links. you'll get to a problematic page soon enough.

thanks a lot for the help.

Reply With Quote
  #2  
Old December 8th, 2003, 07:01 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Why didn't you just use $call throughout? Probably the easiest solution for you will be to go to these problem links and append call=null or something like that to the URL. Then just don't define an include to be pulled in if $call==null.

Reply With Quote
  #3  
Old December 8th, 2003, 04:44 PM
ricky158 ricky158 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 ricky158 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
well, as i said, it is my first time using PHP and i didnt foresee this as being a problem. i only started noticing the problem after i brought in all of my non-call pages and i actually pinpointed the problem after they were all uploaded, so it was a little latecoming on the diagnosis.

anyway, the reason i didnt use call throughout is because i thought it'd be a lot more organized if i could specifically define each page with the address. it's like following a tree: Main page > Reviews > CPS > 1000. call = reviews. reviews = cps. cps = 1000. but i guess when it comes down to it, this is just for organization, and it could be simpler and have the same effect.

i guess my only option is to change everything to call? i have around 120 pages, so if anything could be done solely in the index.php file, that would be preferred, but i guess i did get myself into a rather one-way problem that my only way out of is through the hard and time-consuming way.

another suggestion i heard elsewhere is to use the amperstand (&) and shimmy that in between the call and the variable ($call=reviews&cps) or something like that. any thoughts on that idea?

Reply With Quote
  #4  
Old December 9th, 2003, 11:20 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
I don't know what you're saying at the end there. The other option I suggested should work as well, though it would require changing links in any pages not passing a call variable.

Reply With Quote
  #5  
Old December 9th, 2003, 02:33 PM
ricky158 ricky158 is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 3 ricky158 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
sorry bout that. i should have just used this page as an example.

"showthread.php?s=&postid=24050#post24050"

but changing links to go to call=reviews&cps=2000 or something wouldn't really ease the situation or simplify other solutions.

i'm just trying to find the very simplest way to get the main.html file to be displayed on the first page view and whenver accessed again by editing the index.php file, but it can't interfere with the other pages with non-"call" names.

but of course, if that option isnt available, i'll just take the best advise i could get and fix the problem the long way

Reply With Quote
  #6  
Old December 9th, 2003, 03:11 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
Yeah, I'd do the shimmy thing. A global search and replace should make that fairly quick and easy.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > blank variable interfering with other variables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway