PHP codes not working

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shadyzaftermath
Forum Newbie
Posts: 2
Joined: Tue Feb 10, 2009 3:42 am

PHP codes not working

Post by shadyzaftermath »

Hey guys, I'm not a PHP coder.
I'm just trying to get this software working properly.

It's called Split Test Accelerator,which allows multivariate testing on my webpage.

After adding the variables of things I want to test in the admin area, it asked me to post these codes into my webpage.
<?php if ($f[1]==1){echo $code[1];}?>
<?php if ($f[1]==2){echo $code[2];}?>
<?php if ($f[1]==3){echo $code[3];}?>
<?php if ($f[1]==4){echo $code[4];}?>
<?php if ($f[1]==5){echo $code[5];}?>
<?php if ($f[1]==6){echo $code[6];}?>
It doesnt work. I don't understand why.

I've already added the code in .htaccess so my server is able to parse php in html files.
I tried my webpage with the most basic echo "Hello World" and it works fine.

Or is there something wrong with the code above?
abel
Forum Newbie
Posts: 6
Joined: Sun Feb 08, 2009 11:47 am

Re: PHP codes not working

Post by abel »

i think your code above isn't integrated...
f[1] maybe denote an array...
and code[ ] is too..
but...any other code?
exactly not so clear...
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: PHP codes not working

Post by Ziq »

You should be more specific.
It doesnt work. I don't understand why.
What do you mean? Maybe you get some errors?

This is bad designed but absolutely right in syntax code. Try to modify this code:

Code: Select all

 
<?php 
var_dump($f);
var_dump($code);
?>
<?php if ($f[1]==1){echo $code[1];}?>
<?php if ($f[1]==2){echo $code[2];}?>
<?php if ($f[1]==3){echo $code[3];}?>
<?php if ($f[1]==4){echo $code[4];}?>
<?php if ($f[1]==5){echo $code[5];}?>
<?php if ($f[1]==6){echo $code[6];}?>
 

What do you have in output?
shadyzaftermath
Forum Newbie
Posts: 2
Joined: Tue Feb 10, 2009 3:42 am

Re: PHP codes not working

Post by shadyzaftermath »

Ziq wrote:You should be more specific.

This is bad designed but absolutely right in syntax code. Try to modify this code:

Code: Select all

 
<?php 
var_dump($f);
var_dump($code);
?>
<?php if ($f[1]==1){echo $code[1];}?>
<?php if ($f[1]==2){echo $code[2];}?>
<?php if ($f[1]==3){echo $code[3];}?>
<?php if ($f[1]==4){echo $code[4];}?>
<?php if ($f[1]==5){echo $code[5];}?>
<?php if ($f[1]==6){echo $code[6];}?>
 

What do you have in output?
This software rotates the variable i choose on my webpage.
So,for example, i choose 6 different headlines, type those into the admin area, it gives me these codes. And it generally just rotates different headlines to my visitors.

So visitor A sees Headline 1
B sees Headline 2
and so forth...

The problem im facing now is that the headlines don't even show up.

I think it's like what abel says, there's seems to be no integration.
I'm sorry but i don't quite understand technical talk.

Thanks for replying.
User avatar
Ziq
Forum Contributor
Posts: 194
Joined: Mon Aug 25, 2008 12:43 am
Location: Russia, Voronezh

Re: PHP codes not working

Post by Ziq »

Can you replace this code

Code: Select all

 
<?php if ($f[1]==1){echo $code[1];}?>
<?php if ($f[1]==2){echo $code[2];}?>
<?php if ($f[1]==3){echo $code[3];}?>
<?php if ($f[1]==4){echo $code[4];}?>
<?php if ($f[1]==5){echo $code[5];}?>
<?php if ($f[1]==6){echo $code[6];}?>
 
to

Code: Select all

 
<?php
var_dump($f);
var_dump($code);
?>
<?php if ($f[1]==1){echo $code[1];}?>
<?php if ($f[1]==2){echo $code[2];}?>
<?php if ($f[1]==3){echo $code[3];}?>
<?php if ($f[1]==4){echo $code[4];}?>
<?php if ($f[1]==5){echo $code[5];}?>
<?php if ($f[1]==6){echo $code[6];}?>
 
?

I think you have problem with $f or $code variables. But judging by this piece of code i cannot check this.

When I said "output" I mean "What do you see in your browser then load the page".
Post Reply