|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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:
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. |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
|||
|
|||
|
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? |
|
#4
|
||||
|
||||
|
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.
|
|
#5
|
|||
|
|||
|
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 ![]() |
|
#6
|
||||
|
||||
|
Yeah, I'd do the shimmy thing. A global search and replace should make that fairly quick and easy.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > blank variable interfering with other variables |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|