Current location: Hot Scripts Forums » Programming Languages » PHP » Help Me!!!

Help Me!!!

Reply
  #1 (permalink)  
Old
New Member
 
Join Date: Oct 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Help Me!!!

<?php $say=0 ?>

<script>
for(var j=0;j<limit;j++)
{
tipi[j] = " <?php echo "$tipi[$say]" ?> ";
gun[j] = " <?php echo "$gun[$say]" ?> ";
ay[j] = " <?php echo "$ay[$say]" ?> ";
yil[j] = " <?php echo "$yil[$say]" ?> ";
adres[j] = " <?php echo "$adres[$say]" ?> ";
cinsiyet[j] = " <?php echo "$cinsiyet[$say]" ?> ";
<?php $say++; ?>
}

<script/>

I want to increase $say . but not working. $say always is 0 . What can I do ?
Reply With Quote

Featured Marketplace Scripts (view more)

  #2 (permalink)  
Old
Niall's Avatar
Newbie Coder
 
Join Date: Feb 2011
Location: Kernow
Posts: 93
Thanks: 11
Thanked 3 Times in 3 Posts
This looks to me like a combination of Javascript and PHP, not just PHP.
I'm guessing that the code between the { } is a loop that only stops when certain conditions are met.

Your PHP code should have semi-colons like this:

tipi[j] = " <?php echo "$tipi[$say]"; ?> ";
gun[j] = " <?php echo "$gun[$say]"; ?> ";
ay[j] = " <?php echo "$ay[$say]"; ?> ";
yil[j] = " <?php echo "$yil[$say]"; ?> ";
adres[j] = " <?php echo "$adres[$say]"; ?> ";
cinsiyet[j] = " <?php echo "$cinsiyet[$say]"; ?> ";

Apart from that, I can't see any problem with the PHP code. I'd advise you to post this on the Javascript section of the forum because it's probably a problem with the loop.
Reply With Quote
  #3 (permalink)  
Old
Newbie Coder
 
Join Date: Jul 2010
Posts: 32
Thanks: 0
Thanked 3 Times in 3 Posts
In the loop your $say variable will always be 0, as those are filled before the JavaScript is executed.

Also I can't see your limit variable initialized anywhere.

Your best bet is to do this either fully with JavaScript, or fully with PHP.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 08:52 PM.
vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.