PHP code stopped working after server upgrade to PHP5

No, still just brings up the else page.

BTW, thanks for going back and forth with me on this. I’m not a programmer so I can be slow at times in writing this stuff, but I usually can troubleshoot code. This one just has me stumped.

where are the urls made on which page show me that code:
http://www.jeditemplearchives.com/vintagecollection/evg/tvcVG.php?visual_guide=001-Dengar-The-Vintage-Collection-VC01

This is the page I want to look at.

I need to look at the code that makes the url for you to click.

Oh I see. I don’t have any code that makes the URL. I just type it in manually to pull it up. Nothing genreates that URL.

I think you miss understand me there must be some thing that generates the code or is it static html ?
as a link

or how would anyone get to that url that does not know your url ?

They wouldn’t get to that URL unless I linked to it.

so you put a link in ?
Where do you put the link in ?
Like pulling teeth this is . ;D

I think the problem now is that the rewrite is making the value empty.
So we have to figure out away to put the value back in to the variable.

test this code page.php and test.php click the link in page.php it will send the variable vard to the test.php and print it to screen.

link.php
[php]<?php
echo “link”;
?>[/php]

test.php
[php]

<?php $var = $_GET['var']; echo $var; ?>[/php]

I am going to cheat but this is not good Practice
[php]$p = $_SERVER[‘SCRIPT_NAME’];
$v = @end(explode(’/’, $p));
$visual_guide = str_replace(’.html’,’’,$v);
if(isset($visual_guide)){
echo 'visual_guide = '.$visual_guide;
}else{
echo 'visual_guide = '.$visual_guide;
}[/php]

Sorry to disappear. Had a busy weekend :slight_smile:

I’m still trying to figure out why the logic is no longer working. I dug out one of my files that has very simple code on it. Maybe this will be easier to troubleshoot?

[php]<?php

if ($toypic == “01”) {
print (“Boba Fett (large size)
”);
} elseif ($toypic == “02”) {
print (“See-Threepio (C-3PO) (large size)
”);
} else {
print (“

No figure was selected to display

”);
}
?>[/php]

So, when I load the page all I get is the “No figure was selected to display”.

Here is the link I’m trying to load it from:
http://www.jeditemplearchives.com/vintagepics/vingallery01large.php?toypic=01

Normally I have it load in a nice box and it doesn’t repeat, but for testing purposes a direct link is easier.

By the way, one thing I noticed when fooling around with the logic script is that if I use 1 “=” instead of “==” it loads the first item with any link I try. So, while that doesn’t fix it it does show some type of ‘progress’ I guess.

Success! Here is what I added to the top:

[php]$visual_guide = $_GET[‘visual_guide’];[/php]

It was close to what you initially suggested, but I forgot to add the [php]$visual_guide =[/php] to the front end.

With that fixed, now I need help with an array on the same page :-). That also no longer works.

I did suggest it a while back

I was positive I tried that too. Maybe the extra echo statement made it not work. Thanks again!

Wanna take a crack at getting my array to work now? :slight_smile:

echo does nothing just prints to screen, so it cant stop anything working.
post your array then

Got it. I must have done something wrong on my initial attempt then for it to fail. Thanks again, they are all updated and working now :slight_smile:

The array is actually on the same page. Since each one of these pages have unique content I want the title tag in the page to specific to each page. So, I had an array at the top that used the information from the script we just fixed to label it accordingly. As before, this was working great before the upgrade. Now it just shows my ‘default’ title tag. Here is a cut back version of the page (to save space, just removed all the extra items and did the first few):

[php]<?php
$titles = array(
‘001-Dengar-The-Vintage-Collection-VC01’ => ‘Dengar (Hasbro - The Vintage Collection VC01) - JediTempleArchives.com’,
‘002-Leia-Hoth-Outfit-The-Vintage-Collection-VC02’ => ‘Leia (Hoth Outfit) (Hasbro - The Vintage Collection VC02) - JediTempleArchives.com’,
‘003-Han-Solo-Echo-Base-Outfit-The-Vintage-Collection-VC03’ => ‘Han Solo (Echo Base Outfit) (Hasbro - The Vintage Collection VC03) - JediTempleArchives.com’,
);
if(isset($titles[$visual_guide])) {

echo '<title>', $titles[$visual_guide], '</title>';

} else {
echo ‘The Vintage Collection Visual Guide’;}

?>

#content {width:620px; margin:0px auto;} #desc {margin:10px; float:left; font-family: Arial, sans-serif; font-size: 12px;} <?php include("http://www.jeditemplearchives.com/skins/modern/VG-nav-tvc.shtml"); ?>
       <div class="InfoBox">
        <div class="InfoDetails">
          <p>&nbsp;</p>

 

No Visual Guide Selected. Return to the Archives and try again!

Additional Resources

'); } ?> [/php]

Thats funny because I am sure I asked you for the full code before and you said that is all there is in the page.

move the to the top of the page like i keep saying

[php]<?php
$visual_guide = $_GET[‘visual_guide’];
$titles = array([/php]

That fixed it. Many thanks! I had tried that but left the other one in there too and it didn’t work. I took the second instance out and now it works great.

I had initially stripped out the array when I was troubleshooting with you before because I wanted to solve the major problem first. That’s why it wasn’t in there. Sorry!

That seems to fix all my major problems. I have a search engine that is failing too, but I may try a different one and just abandon that one.

Sponsor our Newsletter | Privacy Policy | Terms of Service