Jump to content

In browser address bar the ? and = replaced by %3D and %3F


werushka

Recommended Posts

I have code like this

 

<?php
							if (!(arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'ilan' && arg(3) == '?' && arg(4) == 'destination' && arg(5) == '=' && arg(6) == 'frontpage')) {
	  						  print "<div id='ilan'>". l('İLAN VER !', "node/add/ilan?destination=frontpage") ."</div>";   }
					?>

 

well this is causing me some problems and breaking the link. The link shows as node/add/ilan%3Fdestination%3Dfrontpage.

 

The "?" and "=" is replaced by %3D and %3F.

 

How can I fix this error. I would really appreciate some feedback.

 

Thanks

sorry for the late reply

 

<?php
function l($text, $path, $options = array()) {
  global $language;

  // Merge in defaults.
  $options += array(
      'attributes' => array(),
      'html' => FALSE,
    );

  // Append active class.
  if (($path == $_GET['q'] || ($path == '<front>' && drupal_is_front_page())) &&
      (empty($options['language']) || $options['language']->language == $language->language)) {
    if (isset($options['attributes']['class'])) {
      $options['attributes']['class'] .= ' active';
    }
    else {
      $options['attributes']['class'] = 'active';
    }
  }

  // Remove all HTML and PHP tags from a tooltip. For best performance, we act only
  // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
  if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {
    $options['attributes']['title'] = strip_tags($options['attributes']['title']);
  }

  return '<a href="'. check_url(url($path, $options)) .'"'. drupal_attributes($options['attributes']) .'>'. ($options['html'] ? $text : check_plain($text)) .'</a>';
}
?>

try this.

 

keep this as a reference to special characters for html.

http://www.degraeve.com/reference/specialcharacters.php


<?php
                        if (!(arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'ilan' && arg(3) == '?' && arg(4) == 'destination' && arg(5) == '=' && arg(6) == 'frontpage')) {
                            print "<div id='ilan'>". l('İLAN VER !', "node/add/ilan?destination=frontpage") ."</div>";   }
                  ?>

thanks for the fast reply actually that spacial charaters is a problem generated when posting here. There is no special characters. Your code is the same as mine.

 

<?php
                        if (!(arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'ilan' && arg(3) == '?' && arg(4) == 'destination' && arg(5) == '=' && arg(6) == 'frontpage')) {
                            print "<div id='ilan'>". l('ilan ver !', "node/add/ilan?destination=frontpage") ."</div>";   }
                  ?>

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.