Page 1 of 1
PHP codes not working
Posted: Tue Feb 10, 2009 3:54 am
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?
Re: PHP codes not working
Posted: Tue Feb 10, 2009 7:17 am
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...
Re: PHP codes not working
Posted: Tue Feb 10, 2009 7:49 am
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?
Re: PHP codes not working
Posted: Tue Feb 10, 2009 11:08 am
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.
Re: PHP codes not working
Posted: Tue Feb 10, 2009 11:36 am
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".