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 9187901
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:53:11+00:00 2026-06-17T19:53:11+00:00

I want to set the url of an iframe using PHP, my url is

  • 0

I want to set the url of an iframe using PHP, my url is in that format : http://mysite.com/s/ where = numbers, I want to make a button that increase the number in the url of 1 and reload the iframe.

<html>
    <head>
        <meta charset="utf-8" />
        <link href="style.css" rel="stylesheet" type="text/css" />
    </head>

    <body>
        <form class="topBorder">
            <p>
                <?php
                    $site = 6394100;

                    function NextSite($sites)
                    {
                        $sites += 1;
                        return 'http://mywebsite.com/s/' . $sites . '/';
                    }

                ?>
                <a href="<?php echo NextSite($sites); ?>" target="frame"> Next </a>
            </p>
            <iframe name="frame" id="frame" src="http://mywebsite.com/s/" class="gagFrame"></iframe>
        </form>
    </body>
</html>
  • 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-17T19:53:12+00:00Added an answer on June 17, 2026 at 7:53 pm

    Well you can take help of a simple JS function for this. See the modified code below. I have not tested it but you should get the idea of doing it.

    EDIT:

    You need to get it done the ajax way. Put your php function in a file say loadurl.php:

                <?php
                    $site = 6394100;
    
                       $sites += 1;
                       echo 'http://mywebsite.com/s/' . $sites . '/';
                ?>
    

    Now in your html code do as follows:

    <html>
    <head>
        <meta charset="utf-8" />
        <link href="style.css" rel="stylesheet" type="text/css" />
    </head>
    
    <body>
        <form class="topBorder">
        <script type="text/javascript">
        function loadURL()
        { 
             $.get('pathToloadurl.php',success(data)
             {
                 window.frames[siteFrame].location =data;
             });
         }
        </script>
       <button type="button" onClick="loadURL()">Next</button>
       <iframe name="siteFrame" id="frame" src="http://mywebsite.com/s/" class="gagFrame"></iframe>
     </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this SQL DECLARE @url varchar(100) SET @url = 'http://mysite.com/%' SELECT [UserSessionSequenceID] ,[SiteID]
Currently I have a url like this http://<client_name>.website.com/index.php?function_name&cat=32 I want to set things up
I have an iframe on a subdomain foo.mysite.com. I want to access the contents
i am using this widget to get my users to create accounts: <iframe src=http://www.facebook.com/plugins/registration.php?
I want to set the Image URL of Image control using client side code
I want to set the url for a user to be example.com/user not example.com/u/user
I have a page located at x.com. On this page is a button that,
I have following link in a.aspx file: <a href=a.htm target=iframe>A</a> I want to set
I want to set page background image my css code is- background:url(images/body_bg.jpg) repeat-x top;
i want to create custom object to get set value on it. -(id)initWithURLString:(NSString *)url

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.