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
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!

Link to comment
Share on other sites

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>";

?>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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!!!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.