I am in Hurry+ help?????

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
crinch
Forum Newbie
Posts: 11
Joined: Fri Jun 16, 2006 6:28 am

I am in Hurry+ help?????

Post by crinch »

twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi,

    I have wasted a lot of time but in vain, i have created an array type variable $com and passes it in window.open('index.php?com=<?=$com?>','300','300');. But when i get it on the index.php page and show the result it showed only me the output as 'Array'.
What is the reason for this. For detail i have put the code here.

Code: Select all

$qry2="select m.*,m.id as mid,c.* from mos_menu m, mos_categories c 
		      where m.name=c.name and m.parent='".$Itemid."'";
			$res2=mysql_query($qry2) or print mysql_error();
			$total2=mysql_num_rows($res2);
			$m=0;
		while($row2=mysql_fetch_object($res2)){
		$com2[$m]=$row2->id;
		$m++;
		}
<input type="button" value="-Compare-"/ onclick="window.open('dummy.php?com31=<?=$com2;?>','300','300');">
/////////////on the index.php page////////////////////

Code: Select all

if(isset($_REQUEST['com31'])) 
 {
 //print "yes";
 //$com=$_REQUEST['com2'];
  for($k=0; $k<=count($_REQUEST['com31']); $k++)
		 {
		  print "\n".$_REQUEST['com31'][$k];
		 }
 }
if any one knows its solution, i am very thankful to him.
Thanks in advance.
Crinch.

twigletmac | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

[quote="[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1"][b]2.[/b] Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.[/quote]
printf
Forum Contributor
Posts: 173
Joined: Wed Jan 12, 2005 5:24 pm

Post by printf »

You will not get to much help with a lame topic title like that!

Anyways, serialize() <= store the array, bin2hex <= make JavaScript safe

change this...

Code: Select all

<input type="button" value="-Compare-"/ onclick="window.open('dummy.php?com31=<?=$com2;?>','300','300');">
to this...

Code: Select all

<input type="button" value="-Compare-"/ onclick="window.open('dummy.php?com31=<?=bin2hex(serialize($com2));?>','300','300');">


Then in your receiving page

change this...

Code: Select all

if(isset($_REQUEST['com31'])) 
{ 
//print "yes"; 
//$com=$_REQUEST['com2']; 
for($k=0; $k<=count($_REQUEST['com31']); $k++) 
{ 
print "\n".$_REQUEST['com31'][$k]; 
} 
}

to something like.... (but validate the input only contains a-z0-9 first)

Code: Select all

if ( isset ( $_REQUEST['com31'] ) )
{
	echo implode ( "\r\n", unserialize ( pack ( 'H*', $_REQUEST['com31'] ) ) );
}

pif!
crinch
Forum Newbie
Posts: 11
Joined: Fri Jun 16, 2006 6:28 am

Thanks, but the title was true.

Post by crinch »

Hi,
I am very thankful to you for this, i realy have spent alot of time for this. now your help make it good.
Actually i am doing a different.
There is a form that has a table and a button(on which we have used window.open), and then i have checkboxes that are being developing with the help of query.I want that, after checking the check boxes, when i clink that button the values should be there on that pop page.
How it is possible, i am waiting for your reply.

Crinch.
Post Reply