PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0
Showing posts with label hyperlink. Show all posts
Showing posts with label hyperlink. Show all posts

Thursday, December 1, 2022

[FIXED] How to force link from iframe to be opened in the parent window

 December 01, 2022     html, html-target, hyperlink, iframe     No comments   

Issue

I need to open the link in the same parent page, instead of open it in a new page.

note : The iframe and parent page are the same domain.


Solution

I found the best solution was to use the base tag. Add the following to the head of the page in the iframe:

<base target="_parent">

This will load all links on the page in the parent window. If you want your links to load in a new window, use:

<base target="_blank">

Browser Support



Answered By - Chris Vasselli
Answer Checked By - Clifford M. (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, November 14, 2022

[FIXED] how to convert exrenal link to internal using .htaccess?

 November 14, 2022     .htaccess, external, hyperlink, redirect     No comments   

Issue

i want convert all external link to internal and redirect them let me show you what i want: i have an external link to my website like this:

<a href ="https://external.com/some text here">link</a>

and i converted it to:

<a href ="https://mywebsite.com/redirect/https://external.com/some text here">link</a>
OR
<a href ="https://mywebsite.com/redirect=https://external.com/some text here">link</a>
OR somthing like this

how can i use .htaccess to make sure when someone opened the link he goes to:

https://external.com/some text here

i tried this but id didn't worked

RewriteEngine On
RewriteRule ^mywebsite.com/redirect/(.*)$ /$1 [NC,L]

Solution

RewriteRule ^mywebsite.com/redirect/(.*)$ /$1 [NC,L]
  • RewriteRule only matches against the path component of the URL. (And when configured in .htaccess context, the path it checks against never starts with a leading slash, the path to the current directory has been stripped off at this point already.)

  • /$1 would cause a slash before the actual substitution URL.

Both fixed, it should simply look like this:

RewriteRule ^redirect/(.*)$ $1 [L]


Answered By - CBroe
Answer Checked By - Marie Seifert (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, November 9, 2022

[FIXED] How to put a link on a button with bootstrap?

 November 09, 2022     button, html, hyperlink, twitter-bootstrap     No comments   

Issue

How would one put a link on a button with bootstrap?

there are 4 methods in the bootstrap documentation:

<a href="#" class="btn btn-info" role="button">Link Button</a>
<button type="button" class="btn btn-info">Button</button>
<input type="button" class="btn btn-info" value="Input Button">
<input type="submit" class="btn btn-info" value="Submit Button">

The first one doesn't work for me, no button shows, just the text with the link, have a feeling its the theme im using.

The second one shows the button which is what i want, but whats the code make the button link to another page when clicked?

Cheers


Solution

You can call a function on click event of button.

<input type="button" class="btn btn-info" value="Input Button" onclick=" relocate_home()">

<script>
function relocate_home()
{
     location.href = "www.yoursite.com";
} 
</script>

OR Use this Code

<a href="#link" class="btn btn-info" role="button">Link Button</a>


Answered By - SAUMYA
Answer Checked By - Marilyn (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Sunday, October 16, 2022

[FIXED] How to add custom link to the main menu

 October 16, 2022     hyperlink, opencart, opencart-3     No comments   

Issue

I have setup a opencart store. With the options in the category, How to add few custom links options as well?

I am using opencart version 3.0.2.0


Solution

You need to add that custom links in catalog/view/theme//template/common/menu.twig

add your link tag before tag in file.



Answered By - Radhika
Answer Checked By - Terry (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, October 5, 2022

[FIXED] how to add multiple link in a cell with phpExcel

 October 05, 2022     hyperlink, php, phpexcel, url     No comments   

Issue

I have a cell with multiple Link

+---------+---------+
|         |         |
| Cell 1  | Cell 2  |
|         |         |
+---------+---------+
|         | Link 1  |
|  ROW 1  | Link 2  |
|         | Link 3  |
+---------+---------+

how can I make this with phpExcel ? I know below code can set hyperlink to a cell but i don't know how can set multiple link to a cell!

$objPHPExcelExport->setActiveSheetIndex(0)
                    ->setCellValue('A'.$index, $row)
                    ->setCellValue('B'.$index, $link);
$objPHPExcelExport->getActiveSheet()
                    ->getCell('B'.$index)
                    ->getHyperlink()
                    ->setUrl('http://'.$url);

Solution

I'm not aware that you can.... how would you do it in MS Excel? As far as I know, MS Excel allows a single link for the cell, not links for indivdual text blocks within that cell.

Even using MS Excel's HYPERLINK() function, and creating a concatenated string combining all the links

=HYPERLINK("http://www.google.co.uk","GOOGLE")&CHAR(10)&HYPERLINK("http://www.amazon.co.uk","AMAZON")

doesn't achieve your objective.


So I don't beleive that what you want to do can be achieved in MS Excel; an if MS Exel doesn't allow it, then nor will PHPEexcel



Answered By - Mark Baker
Answer Checked By - Timothy Miller (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, August 24, 2022

[FIXED] How to know if an object has IN-LINKS in DXL

 August 24, 2022     hyperlink, ibm-doors, module, object, system     No comments   

Issue

I'm trying to make a DXL program that looks the IN-LINKS of a given object.

I will explain myself better: in my system, the links goes from SW to SYS modules, and for the SW modules I need to see some things about the SYS attributes linked to software. But for the SYS modules I need to see diferent things from these attributes.

Besides, due to requirements I need to differentiate the two cases (SW and SYS), so I connot check what I need only with the software OUT-LINKS (in other words, I have to enter systems, look at some things, say that I m in systems and check the IN-LINKS.

I have tried to do something like I would do in SW, but nothing.

In SW, i check the OUT-LINKS with:

for SW_object in SW_module do {
    
  for OUT_link in SW_object -> "*" do {
    
    /* TODO: make the comprobations */
    
  }

}

and this works, but for SYS:

for SYS_object in SYS_module do {
    
  for IN_link in SYS_object <- "*" do {
    
     /* TODO: make the comprobations */
    
  }

}

This code only works if the SW module linked is previously opened. But I can't open this module previously because I don't known which is this module.

Is there a better way or does anyone have any ideas how to do this?

Thanks )


Solution

You are looking for link references (type LinkRef). Check the DXL manual at https://www.ibm.com/support/knowledgecenter/SSYQBZ_9.6.1/com.ibm.doors.requirements.doc/topics/dxl_reference_manual.pdf, chapter "Links"->"Finding Links"->"for each incoming link". Syntax:

for LinkRef in Object tgtObject<-(string linkModuleName) do {
 ...
}

Perhaps you should read the complete chapter "Finding Links" to be aware of more specific cases like links from baselines, information about echoed links etc.



Answered By - Mike
Answer Checked By - Robin (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, August 23, 2022

[FIXED] How to set active menu links under 'My Account' in Magento 2 frontend Customer Section

 August 23, 2022     account, hyperlink, magento, magento2     No comments   

Issue

I've got a custom module extending the customer account section. I've added a new link called 'My Uploads'. This link appears at the bottom of the My Account links sidebar. On the index page, the 'My Uploads' link is bolded and not selectable. However on my child pages none of the links are bolded or selectable. I am searching how to keep the same link functionality in my custom module (i.e. all parent and child pages show the same sidebar link as active.) _SetActiveMenu appears to only be a method accessible in admin controllers so I really don't know any way to do this. Anyone have any clues?


Solution

If I am not mistaken, you want to add a link in Customers "My Account" Sidebar. So, navigation.php which is available in /app/code/local/themename/customer/block/account/navigation.php controling those links. There are few function inside the file, some of them :

public function isActive($link)  
{
if (empty($this->_activeLink)) {
    $this->_activeLink = $this->getAction()->getFullActionName('/');
}
if ($this->_completePath($link->getPath()) == $this->_activeLink) {
    return true;
}
return false;
} 


public function setActive($path)
{
    $this->_activeLink = $this->_completePath($path);
    return $this;
}


Answered By - OÄŸuz Çelikdemir
Answer Checked By - Marie Seifert (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, August 3, 2022

[FIXED] How do I render a hyperlink in a Dash table? (DataTable or dbc Table)

 August 03, 2022     dash-bootstrap-components, html-table, hyperlink, plotly-dash, python     No comments   

Issue

I'm currently working on a Dash frontend interface (python), where I'm loading data from a Pandas dataframe into a table.

My question is: How do I render a hyperlink in a table? I would be interested for solutions with both Dash's DataTable component, but also with dbc Table (Dash Bootstrap Components) which I'm using in my implementation.

Below you can find the simplified and summarized code how I load the dataframe into the dbc Table component. Basically, when the user clicks on the search button, the query in the State is used as a parameter for a POST request. The response JSON is mapped and here I try to render a hyperlink - so far without success.

import dash_bootstrap_components as dbc
import pandas as pd
from dash import html, Input, Output, State
from app import app, backend_api


layout = html.Div(
    dbc.Button("Search", id='search-button'),
    dbc.Table(id="table"),
)


@app.callback(
    Output(component_id='table', component_property='children'),
    Input(component_id='search-button', component_property='n_clicks'),
    State(component_id='query', component_property='value'),
    State('session', 'data'),
)
def search(n_clicks, query, session):
    if not is_token_valid(token):
        return None
    response_json = backend_api.post_json_secure("/api/search/search/", token=token, payload=query)
    json_mapped = map_json(response_json)
    data = pd.json_normalize(json_mapped)
    table = dbc.Table.from_dataframe(data, striped=False, bordered=False, hover=False)
    return table


def map_json(json):
    # misc processing and try to render hyperlink
    mapped = ({
        "Column A": item["value_a"],
        "Column B": item["value_b"],
        "Column C": item["value_c"],
        "Link": create_link(item["link"]),
    } for item in json)
    return mapped


def create_link(url):
    # url is for example https://www.google.com
    # return url  # doesn't work
    # return f'<a href="{url}"/>  # doesn't work either
    # how do I create a hyperlink here?

This is the result for now - as you can see there is only text in the Link column - I'd rather want a real hyperlink here.

enter image description here


Solution

Solution with dbc Table (Dash Bootstrap Components)

def create_link(url):
    return html.A(html.P('Link'), href=url)
    # alternatively use dcc.Link instead of html.A to prevent page refresh

Solution with Dash's DataTable component

Here you have to use "presentation": "markdown" in the column configuration:

# example with only one column and row
data_table = dash_table.DataTable(
    id="table",
    columns=[{"name": "link", "id": "column_link", "presentation": "markdown"}],
    data=[{"html": '<a href="https://www.google.com">Link</a>'}], 
    markdown_options={"html": True},
)

Result:

enter image description here



Answered By - gru
Answer Checked By - Timothy Miller (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, August 2, 2022

[FIXED] How can I make each row of my table dynamic when I click on it?

 August 02, 2022     html-table, hyperlink, react-router-dom, reactjs     No comments   

Issue

I have the following table made in Django and I want to do the same but with react.

I want each row in my table to be clickable with a dynamic link pointing to said record.

Example:

<tbody>
  {% for i in inventories %}
  <tr onclick="location.href='/inventory/detail/{{i.id}}'">
    <td>{{i.name}}</td>
  </tr>
  {% endfor %}
</tbody>

React:

<Tbody>
  {companies.map((company, index) => (
    <Tr key={index}>
      <Td>{company.company_id}</Td>
      <Td>{company.social_reason_name}</Td>
      <Td>{company.comercial_name}</Td>
      <Td>{company.alias_name}</Td>
      <Td>{company.rnc}</Td>
    </Tr>
  ))}
</Tbody>

How can I make each Tr row in the table become a dynamic link?


Solution

Import the Link component and wrap the row content. Compute and pass the target path to the Link component's to prop.

Example:

import { Link } from 'react-router-dom';

...

<Tbody>
  {companies.map((company, index) => (
    <Tr key={index}>
      <Link to={`/company/detail/${company.company_id}`}>
        <Td>{company.company_id}</Td>
        <Td>{company.social_reason_name}</Td>
        <Td>{company.comercial_name}</Td>
        <Td>{company.alias_name}</Td>
        <Td>{company.rnc}</Td>
      </Link>
    </Tr>
  ))}
</Tbody>


Answered By - Drew Reese
Answer Checked By - Senaida (PHPFixing Volunteer)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Tuesday, July 12, 2022

[FIXED] How to add a touchable Url link to a url in a UIAlertView's message?

 July 12, 2022     hyperlink, message, objective-c, uialertview, url     No comments   

Issue

I want to add a clickable link of an url into UIAlertView's message. Such that when user sees the alert view, they can can touch on link inside message. Alternatively they can go next by clicking on the OK button.

Is possible to do it? How?


Solution

The only way I see to implement what you are trying to is through a custom alert view.

There are several approaches that you can take. One is subclassing UIAlertView and here you can find a short tutorial: Subclass UIAlertView. In your subclass you could then build the alert any way you like to implement the touch-enabled text. Have a look at this tutorial for a way to do it.



Answered By - sergio
Answer Checked By - Robin (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, July 8, 2022

[FIXED] How to scroll to post link in Wordpress

 July 08, 2022     hyperlink, posts, scroll, wordpress     No comments   

Issue

My 'hero' element is taking most of the top page, and an user would have to manually scroll past it to get to the content.

I want to change it so that clicking the links will scroll past the image and down to the posts title. At the minute, clicking the post reloads the page and the hero element is on top. But if you click 'more' tag, it scrolls nicely.

How do I make it so that clicking the link will scroll the page down in Wordpress? I don't mean 'more' tag. Maybe there is a way to update the link functions in WP so the links will create anchor like 'more' tag?

I haven`t got a code that creates a link, as they are created by WP (they are post links).

<div class="big">

</div>

<article><div class="post">
if (have_posts()) :
    while (have_posts()) : the_post(); ?>
  <?php the_content(); ?>
</div></article>

.big {
  height: 1200px;
  width: 900px;
  background-color: grey;
}

JS Fiddle: https://jsfiddle.net/tvue1mwo/

single.php code:

<?php
if (is_single()) {
    // Currently using get_header('posts'), so I can hide hero element by css and unhide it with js

    get_header('posts');

    // If I understand right, here should go the ANCHOR link?
}
else {
    // Loads normal hero withou extra css class
    get_header();
}
?>
<div class="main-section wrapper">
<?php
    if (have_posts()) :
        while (have_posts()) : the_post(); ?>
    <div class="post-content u-cf">
        <h2 class="post"><a href="<?php the_permalink(); ?>">
            <?php the_title(); ?></a></h2>
            <p class="post-info"><i class="fa fa-folder-open" aria-hidden="true"></i>  
                <?php 
                $categories = get_the_category(); 
                $separator = ", ";
                $output = '';
                if ($categories) {
                    foreach ($categories as $category) {
                        $output .= '<a href="' . get_category_link($category->term_id) . '">' . $category->cat_name . '</a>' . $separator;
                    }
                    echo trim($output, $separator);
                }
                ?>
                |
                <i class="fa fa-clock-o" aria-hidden="true"></i> <?php the_time('j/m/Y'); ?>
            </p>
            <div class="banner-image"><?php the_post_thumbnail('banner-image'); ?></div>
            <?php the_content(); ?>
        <?php endwhile; ?>
    </div>
    <?php
    else :
        echo '<p> No Content found</p>';
    endif; ?>
</div>
<?php get_footer(); ?>

index.php:

<?php 
if (have_posts()) :?>
<?php $count = 1; 
while (have_posts()) : the_post(); ?>

<div class="post-content u-cf">

    <?php if (has_post_thumbnail()) {
        ?>
        <div class="post-thumbnail u-cf"><a href="<?php the_permalink(); ?>">
            <?php the_post_thumbnail('small-thumbnail')  ?></a>
        </div>
        <?php } ?>

        <h2 class="post">
            <a href="<?php the_permalink(); ?>">
                <?php the_title(); ?>
            </a>
        </h2>

        <p class="post-info"><i class="fa fa-folder-open" aria-hidden="true"></i>  
            <?php 
            $categories = get_the_category(); 
            $separator = ", ";
            $output = '';

            if ($categories) {

                foreach ($categories as $category) {
                    $output .= '<a href="' . get_category_link($category->term_id) . '">' . $category->cat_name . '</a>' . $separator;
                }

                echo trim ($output, $separator);
            }
            ?>
            |<i class="fa fa-clock-o" aria-hidden="true"></i> <?php the_time('j/m/Y'); ?>
        </p>

        <?php the_content(); ?>
        <hr>

        <?php   if ( 2 === $count ) { ?>

        <div class="main-content-advert">
            <p>Lorem ipsum</p><p>Lorem impsum</p>
        </div>
        <hr>

        <?php }

        $count++; ?>  
    <?php endwhile; ?>

</div>
<?php
else :
    echo '<p> No Content found</p>';

endif; ?>

Solution

If you are using index.php to display the homepage & archives, you can do the following:

<?php 
/* 1. define the name of the anchor to jump to */
$anchorname = "skipheroimage"; 
$count = 0;

if (have_posts()) :
    while (have_posts()) : the_post(); 
    ?>
        <?php 
        $count++; /* increment the count so that each anchor is unique on the page */
        /* 2. add the anchor to the permalink so it will jump directly to the anchor  */
        $linkwithanchor = get_permalink()."#".$anchorname.$count; 
        ?>

        <div class="post-content u-cf">
            /* 3. use our $linkwithanchor variable to create the link */
            <h2 class="post"><a href="<?php echo $linkwithanchor; ?>"> 
            <?php the_title(); ?></a></h2>


            /* no change to the code that was here, so keep it as it was...
               ... I just removed it to make my changes easier to find */


            <div class="banner-image"><?php the_post_thumbnail('banner-image'); ?></div>

             /* 4. add our anchor - this is where the link will jump to */
            <a id="<?php echo $anchorname.$count; ?>" name="<?php echo $anchorname.$count; ?>"></a>
            <?php the_content(); ?>
        </div> /* NOTE  - you had this in the wrong place. */
   <?php endwhile; ?>
<?php
else :
    echo '<p> No Content found</p>';
endif; ?>

This will create an anchor directly after the banner image, and add the anchor name to the link so that it will jump directly to it.

I have commented and numbered each step directly in the code.

You will need to do this for any templates you have that displays the links (e.g. archive.php)



Answered By - FluffyKitten
Answer Checked By - Cary Denson (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, May 6, 2022

[FIXED] how do I echo a website-linked photo in php?

 May 06, 2022     html, hyperlink, image, php     No comments   

Issue

I've looked at every other example of the problem I'm having and none have covered how to do an actual website URL link within an echoed image in PHP. I'm sure I have to use an escape character of some sort but I'm not sure where or which one. here is my code

<?php
echo "<a href=\'https://validator.w3.org/nu/"><img src="HTMLVALIDATIONIMAGE.png"  /></a>";
echo "<a href=\'https://validator.w3.org/nu/"><img src="CSSVALIDATIONIMAGE.png"  /></a>"";
echo "<b>Last Modified:</b> " . date('F d Y h:i A', filemtime($_SERVER['SCRIPT_FILENAME']));
?>

Solution

Use single quotes around the HTML attributes when you're using double quotes around the PHP string. Then you don't need to escape anything.

echo "<a href='https://validator.w3.org/nu/'><img src='HTMLVALIDATIONIMAGE.png'></a>";


Answered By - Barmar
Answer Checked By - Timothy Miller (PHPFixing Admin)
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Saturday, February 26, 2022

[FIXED] How to link favicon icon at Laravel

 February 26, 2022     favicon, hyperlink, laravel     No comments   

Issue

We know how to link HTML images and CSS files according to the following code.

{{ HTML::image('images/example.jpeg', 'Example Image') }}
{{ HTML::style('css/main.css') }}

But, how to link the favicon icon at Laravel as we can not do like a static HTML file?


Solution

For Laravel 5.xx

We can link favicon icon and css file in the following way. In Laravel application put your favicon icon and css file under the public folder. In my case, I put them public/css folder.

<link rel="shortcut icon" href="{{ asset('img/favicon.png') }}">
<link href="{{ asset('css/style.css') }}" rel="stylesheet">

For Laravel 6.00

<link rel="icon" href="{{ URL::asset('/css/favicon.jpg') }}" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="{{ URL::asset('/css/app.css')  }}">

For Laravel 8.00

<link rel="icon" href="{{ url('css/favicon.jpg') }}">
<link rel="stylesheet" type="text/css" href="{{ url('css/style.css') }}">


Answered By - Ahmad Sharif
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Thursday, January 27, 2022

[FIXED] remove image in wordpress admin panel

 January 27, 2022     hyperlink, image, php, wordpress     No comments   

Issue

I want to add <a> tag to <i> that will remove an image when I press on the icon. Here is a code to WP gallery in this plugin:

<# if ( data.values[0] ) { #>
    <div class="main_image">
        <div class="main_image_droppable">
            <div class="inner">
                <div class="inner-bordered">
                    <i class="fa fa-file-image-o"></i>
                </div>
                <span>{{ data.l10n.drop }}</span>
            </div>
        </div>
        <img src="{{data.values[0].src}}" />
    </div>
    <div class="stm_mini_thumbs">
        <# _.each( data.values, function( img, id) { #>
            <div class="thumbs">
                <div class="inner">
                    <img src="{{img.thumb}}" />
                    <div class="inner-hover">
                  /* <a> tag should be here */      <i class="fa fa-remove" data-delete="{{id}}"></i>
                        <i class="fa fa-arrows"></i>
                    </div>
                </div>
            </div>
        <# } ) #>
    </div>
<# } else { #>
    <div class="butterbean-placeholder">{{ data.l10n.placeholder }}</div>
<# } #>

I want to delete it without reloading the page. I don't know how to do this at all.


Solution

You can achieve this with a little of JS/jQuery, just wrap the i tag inside an a tag with specific class:

<a href="#" class="image-remove-btn"><i class="fa fa-remove" data-delete="{{id}}"></i></a>

And use jQuery to listen to click event to remove the image

jQuery(document).ready(function($) {
    $(document).on('click', '.image-remove-btn', function (e) {
        $(this).closest('.thumbs').remove();
    });
});

Make sure the thumbs class in $(this).closest('.thumbs') is the correct class for the image container.



Answered By - Ali_k
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Wednesday, January 12, 2022

[FIXED] Links not relative in cakephp

 January 12, 2022     cakephp, html-helper, hyperlink, php, relative-path     No comments   

Issue

In my layout, I have a menu that I've included as an element, and it contains a link like so.

<? $html->link('New Part Number','/part_numbers/add'); ?>

The problem that I have is that cake isn't redirecting correctly and it ends up sending me to "http://localhost/part_numbers/add" instead of "http://localhost/my_client_folder/client_app/part_numbers/add" (I'm building this locally). My CakePHP app is stored a few directories below my webroot folder, but I thought CakePHP would autodetect how to build the linking no matter where the application was located, right?

So do I need to configure the application root folder, or create a route or something?


Solution

Thank you everyone for your solutions, my previous solution was indeed in error:

You have to build it off of "$this" so that it knows where you're coming from, otherwise it can't figure out how to build a relative link.

Html->link("New Part Number", array('controller' => 'part_numbers', 'action' => 'add')); ?>

The REAL reason that the links were not working, as kindly mentioned below, was because of not specifying the array. This should work to fix the link:

<?= $html->link("New Part Number", array('controller' => 'part_numbers', 'action' => 'add')); ?>


Answered By - Dan
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Monday, January 10, 2022

[FIXED] Insert link with yii framework

 January 10, 2022     hyperlink, php, yii     No comments   

Issue

I'm developing a web app with yii framework in php.

In html code i have something like this:

<a href="search.php" class="btn_buscar">
    <h3>Search</h3>
    <div class="icon_menu">
    </div>
</a>

¿ How can I do that with CHtml::link in yii framework?

Thank you :)


Solution

This should work:

echo CHtml::link('<h3>Search</h3><div class="icon_menu"></div>','search.php',array('class'=>'btn_buscar'));


Answered By - Pitchinnate
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg

Friday, December 31, 2021

[FIXED] Using codeigniter 4, cannot send link in gmail

 December 31, 2021     codeigniter, gmail, href, hyperlink     No comments   

Issue

$message = "Hi ".$name.", <br>Your account is created successfully. Please click the below link to activate your account
<br><br><a href=".base_url()."/register/activate/".$uniid."Activate now </a>";

I already recieved the email but the href function is excluded. it only display "Hi myname, Your account is created successfully. Please click the below link to activate your account";

it dont display the link


Solution

You have syntax errors in your code.

  1. Missing > in anchor tag".$uniid."Activate now
  2. Wrong href dicleration href=".base_url()."/register/activate/".$uniid."
  3. wrap inner conditions with '.

Use below code

$message = "Hi {$name}, <br>Your account is created successfully. Please click the below link to activate your account
<br><br><a href='/register/activate/{$uniid}'>Activate now </a>";


Answered By - Abdulla Nilam
Read More
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Older Posts Home
View mobile version

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
All Comments
Atom
All Comments

Copyright © PHPFixing