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

  • Home
  • SEARCH
  • 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 97313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:58:52+00:00 2026-05-10T23:58:52+00:00

I have this php code, with which I am trying to generate a popup

  • 0

I have this php code, with which I am trying to generate a popup window that will contain the contents of a html file, however after adding in the script tags, no html is displayed. I tried echoing out $row2, but the word array is printed to the screen and nothing else.

<?php session_start(); if (isset($_GET['cmd']))   $cmd = $_GET['cmd']; else   die('You should have a 'cmd' parameter in your URL');  $pk = $_GET['pk']; $con = mysql_connect('localhost','root','geheim'); if(!$con) { die('Connection failed because of' .mysql_error()); } mysql_select_db('ebay',$con); if($cmd=='GetAuctionData') { $sql='SELECT * FROM Auctions WHERE ARTICLE_NO ='$pk''; $sql2='SELECT ARTICLE_DESC FROM Auctions WHERE ARTICLE_NO ='$pk''; $htmlset = mysql_query($sql2); $row2 = mysql_fetch_array($htmlset); echo $row2; echo '<script>  function makewindows(){ child1 = window.open ('about:blank'); child1.document.write('.$row2['ARTICLE_DESC'].'); child1.document.close();  } </script>';  $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) { echo '<div id='leftlayer'>     <strong>Article Number</strong> '.$row['ARTICLE_NO'].'     <p><strong>Article Name</strong></p> '.$row['ARTICLE_NAME'].'     <p><strong>Subtitle</strong></p> '.$row['SUBTITLE'].'     <p><strong>Username</strong></p> '.$row['USERNAME'].'     <p><strong>Total Selling</strong></p> '.$row['QUANT_TOTAL'].'     <p><strong>Total Sold</strong></p> '.$row['QUANT_SOLD'].'     <p><strong>Category</strong></p> '.$row['CATEGORY'].'     <p><strong>Highest Bidder</strong></p> '.$row['BEST_BIDDER_ID'].'   </div> <div class='leftlayer2'>   <strong>Current Bid</strong> '.$row['CURRENT_BID'].'   <p><strong>Start Price</strong></p> '.$row['START_PRICE'].'   <p><strong>Buyitnow Price</strong></p> '.$row['BUYITNOW_PRICE'].'   <p><strong>Bid Count</strong></p> '.$row['BID_COUNT'].'   <p><strong>Start Date</strong></p> '.$row['ACCESSSTARTS'].'   <p><strong>End Date</strong></p> '.$row['ACCESSENDS'].'   <p><strong>Original End</strong></p> '.$row['ACCESSORIGIN_END'].'   <p><strong>Auction Type</strong></p> '.$row['AUCTION_TYPE'].' </div> <div class='leftlayer2'>     <strong>Private Auction</strong></p> '.$row['PRIVATE_AUCTION'].'   <p><strong>Paypal Accepted</strong></p> '.$row['PAYPAL_ACCEPT'].'   <p><strong>Auction Watched</strong></p> '.$row['WATCH'].'   <p><strong>Finished</strong></p> '.$row['FINISHED'].'   <p><strong>Country</strong></p> '.$row['COUNTRYCODE'].'   <p><strong>Location</strong></p> '.$row['LOCATION'].'   <p><strong>Conditions</strong></p> '.$row['CONDITIONS'].' </div> <div class='leftlayer2'>   <strong>Auction Revised</strong></p> '.$row['REVISED'].'   <p><strong>Cancelled</strong></p> '.$row['PRE_TERMINATED'].'   <p><strong>Shipping to</strong></p> '.$row['SHIPPING_TO'].'   <p><strong>Fee Insertion</strong></p> '.$row['FEE_INSERTION'].'   <p><strong>Fee Final</strong></p> '.$row['FEE_FINAL'].'   <p><strong>Fee Listing</strong></p> '.$row['FEE_LISTING'].'   <p><a href='#' onclick='makewindows(); return false;'>Click for full description </a></p> </div>';  $lastImg = $row['PIC_URL']; echo '<div id='rightlayer'>Picture Picture <img src='.$lastImg.'> </div>';  }  } mysql_close($con); ?> 

edit: I have fixed the errors that Roborg pointed out, however the script will still not load and does not give a precise error.

i have updated the code above

  • 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. 2026-05-10T23:58:53+00:00Added an answer on May 10, 2026 at 11:58 pm

    As well as the missing </script>,

    child1.document.write('.$row2['ARTICLE_DESC'].') should be

    child1.document.write(' . json_encode($row2['ARTICLE_DESC']) . ');

    The json_encode() function will take care of any quoting for you.

    Edit:

    <a href='#' onclick=makewindows()> should be <a href='#' onclick='makewindows(); return false;'> – You should have quotes there, and the return false will stop you getting taken to ‘#’ when you click the link.

    Also, from memory I’m not sure you can open about:blank and then write to it – I think it sees that as cross-domain scripting. You might be better off creating a minimal ‘blank.html’ file on your server and using that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 103k
  • Answers 103k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think that the SolutionToBuild item is empty and nothing… May 11, 2026 at 8:21 pm
  • Editorial Team
    Editorial Team added an answer Pure python solution: import dbus bus = dbus.SystemBus() obj =… May 11, 2026 at 8:21 pm
  • Editorial Team
    Editorial Team added an answer It doesn't return what you expect because grouping happens before… May 11, 2026 at 8:21 pm

Related Questions

I have inherited a client site which crashes every 3 or 4 days. It
I have a mysql database which as one of the fields contains a html
Using PHP, and MySql, I am trying to implement this rather snazzy in-place editor
I am trying to format some bad html to output into a pop window.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.