Jump to content
MakeWebGames

Popup window Item Info


lynm77

Recommended Posts

Hello All

I'm hoping someone may be able to help me.

On my Inventory page i have been attempting to set a info popup page.

I have added the following to header

 

<script type="text/javascript">
<!--
function myPopup2() {
window.open( "http:/description.php?ID={$i['itmid']}'", "myWindow", 
"status = 1, height = 300, width = 300, resizable = 0" )
}
//-->
</script>

 

Then added the following to Info Button on the Inventory page

 

echo "</td><td>\${$i['itmsellprice']}</td><td>";
echo "$".($i['itmsellprice']*$i['inv_qty']);
echo "</td><td><img src='itmpics/{$i['itmpic']}' height='50px' width='50px'>";
echo "</td><td><form>
<input type='button' onClick='myPopup2()' value='Info'>
</form> [<a href='addtoshop.php?ID={$i['inv_id']}'>Put in Shop</a>] [<a href='itemsend.php?ID={$i['inv_id']}'>Send</a>] [<a href='itemsell.php?ID={$i['inv_id']}'>Sell</a>] [<a href='imadd.php?ID={$i['inv_id']}'>Add To Market</a>]";
if($i['itmid']=='1')

 

I have it that it pops up a new pop up window but not the correct details on item

Its is showing the following details in Browser only.

 

http://www.xxxxxxx.com/description.php?ID='

 

Can someone help he to correct the following please.

Thank You

Edited by lynm77
Link to comment
Share on other sites

It works for me, tested it where are you placing this part of the code?

<script type="text/javascript">

<!--

function myPopup2() {

window.open( "http:/description.php?ID={$i['itmid']}'", "myWindow",

"status = 1, height = 300, width = 300, resizable = 0" )

}

//-->

</script>

I added it under the query

then changed it to...

 

echo <<<EOF

<script type="text/javascript">

<!--

function myPopup2() {

window.open( "iteminfo.php?ID={$i['itmid']}", "myWindow",

"status = 1, height = 300, width = 300, resizable = 0" )

}

//-->

</script>

EOF;

and it worked just fine...

Edited by lucky3809
Link to comment
Share on other sites

First of all, doesnt matter where you place the code. Secondly, let's look at the obvious,

<script type="text/javascript">

<!--

function myPopup2() {

window.open( "http:/description.php?ID={$i['itmid']}'", "myWindow"+item,

"status = 1, height = 300, width = 300, resizable = 0" )

}

//-->

</script>

You see the {$i['itmid']}? Ok, let's fix this to be "+item+". Remove the ' also. Then make the function like so: function myPopup2(item) {.

 

Now that that is done.

 

If you can not see this, then your blind. http:/description.php, just type that into your browser and see where your going to. This has to be description.php only.

 

Ok, that's the javascript and hope you can solve it.

 

Here's the php code:

 

echo '</td><td>$'.$i['itmsellprice'].'</td><td>';
echo '$'.($i['itmsellprice'] * $i['inv_qty']);
echo '</td><td><img src="itmpics/'.$i['itmpic'].'" style="height: 50px; width: 50;px;">';
echo '</td><td><form><input type="button" onClick="myPopup2('.$i['itmid'].');return false;" value="Info"></form> [<a href="addtoshop.php?ID='.$i['inv_id'].'">Put in Shop</a>] [<a href="itemsend.php?ID='.$i['inv_id'].'">Send</a>] [<a href="itemsell.php?ID='.$i['inv_id'].'">Sell</a>] [<a href="imadd.php?ID='.$i['inv_id'].'">Add To Market</a>]';

 

 

 

 

 

 

 

 

 

and the javascript if you didnt understand

 

<script type="text/javascript">
function myPopup2(item)	{	window.open('description.php?ID='+item, 'infoItem', 'status = 1, height = 300, width = 300, resizable = 0');	}
</script>
Edited by HauntedDawg
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...