Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:15:19+00:00 2026-06-10T23:15:19+00:00

Okay, so I have a php variable which stores: http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ?v=2&alt=json-in-script&callback=youtubeFeedCallback This is working fine

  • 0

Okay, so I have a php variable which stores:

http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ?v=2&alt=json-in-script&callback=youtubeFeedCallback

This is working fine and i want to do the following:

<script type="text/javascript" src="<?php echo $string; ?>"></script>

But it doesn’t seem to be working

Thanks for any help

EDIT:
Here is my code, tried all 3 answers below but didn’t work:
http://pastebin.com/xYKW8TTd

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:15:20+00:00Added an answer on June 10, 2026 at 11:15 pm

    This seems to work as expected:

    <?php
    
        $string="http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ?v=2&alt=json-in-script&callback=youtubeFeedCallback";
    
    ?>
    
    <script type="text/javascript" src="<?php echo $string; ?>"></script>
    

    with the output of:

    <script type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos/gzDS-Kfd5XQ?v=2&alt=json-in-script&callback=youtubeFeedCallback"></script>
    

    Edit: in your source code on pastebin, you seem to have:

    $string = "http://gdata.youtube.com/feeds/api/videos/" . $id ."?v=2&amp;alt=json-in-script&amp;callback=youtubeFeedCallback";
    

    which contains &amp; in the place of & which would stop the link working. Was this somethign that pastebin did or was it in your original code?

    You can’t send HTML codes to the URL window and expect it to work the same way as if it was in a HTML body.

    The following code (just edited $id as I am not putting anything in GET and modified & symbols gave:

    <html>
    <head>
    <?php
        //$id = $_GET['id'];
        $id=0;
        $string = "http://gdata.youtube.com/feeds/api/videos/" . $id ."?v=2&alt=json-in-script&callback=youtubeFeedCallback";
    ?>
    
    
    <title></title>
    </head>
    <body>
    <?php echo $string; ?><br>
    <script type="text/javascript" src="<?php echo $string; ?>"></script>
    

    Had the output of:

    <title></title>
    </head>
    <body>
    http://gdata.youtube.com/feeds/api/videos/0?v=2&alt=json-in-script&callback=youtubeFeedCallback<br>
    <script type="text/javascript" src="http://gdata.youtube.com/feeds/api/videos/0?v=2&alt=json-in-script&callback=youtubeFeedCallback"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay.. so basically, say we have a link: $url = http://www.site.com/index.php?sub=Mawson&state=QLD&cat=4&page=2&sort=z; Basically, I need
Okay, so I have my post.php page. If you are not logged in, you'll
Okay, I have a WebBrowser control in my VB.NET application that loads a PHP
Okay, I'm stuck. PHP, Regex. I have a string: Это кириллические 23 78these are56
Okay I have a series of objects based on a base class which are
I have a php page which contains a form. Sometimes this page is submitted
Okay - I'm beaten. I have a (PHP-CLI) server written using PHP's socket_* functions.
Okay, I am using (PHP) file_get_contents to read some websites, these sites have only
Okay so I have a form that is using PHP to mail to an
Possible Duplicate: Reading and Writing Configuration Files Okay, I have a config file, which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.