Jump to content

another parse error what's wrong here?


co.ador

Recommended Posts

  <?php  echo  " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage&name=". $_POST['name']. '&zipcode=' . $_POST['zipcode'] .'&state=' . $_POST['state'] . '&food_types= ' . $_REQUEST['frmSearch']['food_types']. '&offerings=' . if (isset ($_REQUEST['frmSearch']['offerings'])){$_REQUEST['frmSearch']['offerings']}else { array()} ."'>></a> ";?>

 

 

I know the parse error laids in around the offering variable.

 

<?php 'offerings=' . if (isset ($_REQUEST['frmSearch']['offerings'])){$_REQUEST['frmSearch']['offerings']}else { array()} ."' ?>

Link to comment
https://forums.phpfreaks.com/topic/189452-another-parse-error-whats-wrong-here/
Share on other sites

<?php 
      echo  "<a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage&name=". $_REQUEST['name']. '&zipcode=' . $_REQUEST['zipcode'] .'&state=' . $_REQUEST['state'] . 
  implode('&food_types= ','&offering' array($_REQUEST['frmSearch']['food_types'] $_REQUEST['frmSearch']['offerings'])"'><</a> ";
?>

 

Is this imploding fucntion done corretly?

 

the above is a pagination link that will retrieve five indexes and two of them are arrays. I have put the two array inside the implode function and the rest outside it's that correct?

 

 

Help!

Maybe something like this:

 

<?php

echo "<a href='{$_SERVER['PHP_SELF']}?currentpage={$nextpage}&name={$_POST['name']}&zipcode={$_POST['zipcode']}&state={$_POST['state']}&food_types=".(is_array($_REQUEST['frmSearch']['food_types'])) ? implode(",", $_REQUEST['frmSearch']['food_types']) : ""."&offerings=".(is_array($_REQUEST['frmSearch']['offerings'])) ? implode(",", $_REQUEST['frmSearch']['offerings']) : ""."'>The Link Text</a>";

?>

I tried the follows but it's not activating the >> as a link.  I think somewhere in between <a the script inside the <a open and the symbol > then it get lost the effect of activating the link.

[code=php:0]<?php echo "<a href='{$_SERVER['PHP_SELF']}?currentpage={$nextpage}&name={$_POST['name']}&zipcode={$_POST['zipcode']}&state={$_POST['state']}&food_types=".(is_array($_REQUEST['frmSearch']['food_types'])) ? implode(",", $_REQUEST['frmSearch']['food_types']) : ""."&offerings=".(is_array($_REQUEST['frmSearch']['offerings'])) ? implode(",", $_REQUEST['frmSearch']['offerings']) : ""."'>>></a>"; ?>

 

 

again the >> is not display as a link rather as a plain text with the script above.

still the problems persists.

 

This is the output of the pagination

 

 

[1] 2 '>»>

 

>>

 

you see >»> it won't link and if you notice in  [1] 2 '>»> the apostrophe ' is part of the closing in the php script inside the <a> tags won't will appear as plain text. I don't see any missing tags or any missing parse characters in there.

 

Hai!!!!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.