www.webdeveloper.com
Results 1 to 10 of 10

Thread: [RESOLVED] how to change html code to php

  1. #1

    resolved [RESOLVED] how to change html code to php

    how can i get the $link to display in html it work on the <?echo $link;?>
    but wont work on just the link if I try to replace the $link with <?echo $link;?> in the <a href code it does not work

    Code:
    	$link = '<a href="' . $value['url'] . '" url="' . $value['url'] . '"' . $target . '>' . $value['url'] . "</a>";
    
    ?>
    <?echo $link;?>
    
    <a href="#" onclick="return false" onmouseover="Tip('<img src=\'http://open.thumbshots.org/image.aspx?url=$link width=\'200\'>')" onmouseout="UnTip()"> 
    
    $link
    
    <?

    so how would I change the
    Code:
    <a href="#" onclick="return false" onmouseover="Tip('<img src=\'http://open.thumbshots.org/image.aspx?url=$link width=\'200\'>')" onmouseout="UnTip()">
    to php


    i tried <?echo '<a href="#" onclick="return false" onmouseover="Tip('<img src=\'http://open.thumbshots.org/image.aspx?url=$link width=\'200\'>')" onmouseout="UnTip()"> '?> but got errors

    i also posted under html just in case someone can help me there
    Last edited by winracer; 01-09-2010 at 12:03 AM. Reason: add
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  2. #2
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    Code:
    ?url=<?echo $link;?> width=
    i also posted under html just in case someone can help me there
    Please don't cross post; if a post is in the wrong forum a mod will move it.
    At least 98% of internet users' DNA is identical to that of chimpanzees

  3. #3
    Join Date
    Jul 2009
    Location
    Falls Church, Va.
    Posts
    780
    @OP

    Your errors resulted in your code because you didn't escape the single quotes you included in your echo statement wrapped by a single quote. Remember the basics, i.e. always escape quotes when wrapped by quotes (either type) and use single quotes to wrap a literal string and double quotes to wrap a string with embedded variables. Simple as that.

  4. #4
    Join Date
    Jan 2006
    Location
    MN
    Posts
    440
    Instead of

    PHP Code:
    ?>
    <?echo $link;?>   <-- why switch out of php mode to echo in php mode? -->
    <?php
    I use

    PHP Code:
    echo $link

  5. #5
    Join Date
    Dec 2009
    Location
    Budapest, HUN
    Posts
    6
    $link = "\"<a href=\"" . $value['url'] . "\" url=\"" . $value['url'] . $target . "\" >" . $value['url'] . "</a>";

    ?>
    <?php
    echo $link;
    ?>

    <a href="#" onclick="return false" onmouseover="Tip('<img src=\'http://open.thumbshots.org/image.aspx?url=$link width=\'200\'>')" onmouseout="UnTip()">

    <?php echo $link; ?>

  6. #6
    Quote Originally Posted by Fang View Post
    Code:
    ?url=<?echo $link;?> width=
    Please don't cross post; if a post is in the wrong forum a mod will move it.


    sorry, this does not work

    it displays the url and this on screen/webpage

    width==\'200\'>')" onmouseout="UnTip()">


    thanks
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  7. #7
    Quote Originally Posted by Dasher View Post
    Instead of

    PHP Code:
    ?>
    <?echo $link;?>   <-- why switch out of php mode to echo in php mode? -->
    <?php
    I use

    PHP Code:
    echo $link


    sorry i guess i did not explain my self


    what I need it the $link to work here or change this to php code and not html

    Code:
    <a href="#" onclick="return false" onmouseover="Tip('<img src=\'http://open.thumbshots.org/image.aspx?url=$link width=\'200\'>')" onmouseout="UnTip()">

    thanks
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  8. #8
    Join Date
    Dec 2009
    Location
    Budapest, HUN
    Posts
    6
    U mean this (?):

    <?php

    echo "<a href=\"#\" onclick=\"return false\" onmouseover=\"Tip(\'<img src='http://open.thumbshots.org/image.aspx?url=$link'\' width=\"200\" >)\" onmouseout=\"UnTip()\">";

    ?>

    I'm not sure enough about the single quotes... =)

    Have a nice day! =)

  9. #9
    Quote Originally Posted by benkus View Post
    U mean this (?):

    <?php

    echo "<a href=\"#\" onclick=\"return false\" onmouseover=\"Tip(\'<img src='http://open.thumbshots.org/image.aspx?url=$link'\' width=\"200\" >)\" onmouseout=\"UnTip()\">";

    ?>

    I'm not sure enough about the single quotes... =)

    Have a nice day! =)

    thanks, this help i got it to work........ sometime the little things are the hardest
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  10. #10
    Join Date
    Dec 2009
    Location
    Budapest, HUN
    Posts
    6
    Quote Originally Posted by winracer View Post
    thanks, this help i got it to work........ sometime the little things are the hardest
    I know what u mean... Ur welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center

"

"

X vBulletin 4.2.2 Debug Information

  • Page Generation 0.43483 seconds
  • Memory Usage 2,958KB
  • Queries Executed 15 (?)
More Information
Template Usage (35):
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (5)bbcode_code
  • (4)bbcode_php
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (10)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • bbcode_parse_start
  • postbit_imicons
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates