-
Jun 19th, 2013, 03:17 AM
#1
Thread Starter
Member
[PHP] Open new window for update
Hi.. it's been a long time to post here.
I'm a new coder in PHP and i have some problem on my first project.
i just want to have a popup window where i can update my database regarding on what record no that i click.
here's some of my poor code (sorry im a newbie).. hope you understand my problem guys..
thanks a lot...
PHP Code:
<script type="text/javascript" language="javascript"> function OpenWindow() { window.open ('UpdateASUSLack.php','','width=200,height=100') } </script>
<?php $lackQuery=mysql_query("select * from tbl_asus_lacking WHERE status='Open'");
while ($Result=mysql_fetch_array($lackQuery)) { echo "<tr>"; echo "<form action='ViewASUSLacking.php' method='post'>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['UnitPN']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['UnitDesc']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['OldSN']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['NewSN']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['LackPN']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['LackDesc']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['Customer']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['Location']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['RMANo']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['Station']."</td>"; echo "<td class='text1' bgcolor='$bgcolor' align='left'>".$Result['inputDate']."</td>"; echo "<td class='text1' align='center' bgcolor='$bgcolor'>"."<input type='submit' name='close' value='update' id='$Result[RecNo]' onclick='OpenWindow()'>"."</td>"; echo "</form>"; } ?>
-
Jun 19th, 2013, 03:18 AM
#2
Thread Starter
Member
Re: [PHP] Open new window for update
the problem is i dont know how can i display the record no from my opener window to new window.
and the new window will let me update the data based on record no will show up (which came from the window.opener) on new window.
please kinldy help me.
thanks in advanced.
Last edited by disinwebe; Jun 19th, 2013 at 03:34 AM.
-
Jun 19th, 2013, 03:31 AM
#3
Thread Starter
Member
Re: [PHP] Open new window for update
This could be help.
-
Jun 19th, 2013, 08:57 AM
#4
Addicted Member
Re: [PHP] Open new window for update
i was thinking what i was gonna tell you since i was reading another post...hope this post will help you since i cannot access the internet in here (they say its for security reason) anyway, if you are trying to have another window popup you should use java-script for that..but you can redirect the user to another page by using header function for php or meta refresh for html. since you are using window.open , and regarding to your #3 post if its a page you can use onclick event to popup a simple window instead of a new page to edit any record , a little bit more information would be good for other ppl that would check this thread
Good Day
Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
All the big things started from little! teef my tsap evom sekans ,duol raor slluB
Lietome.ir
-
Jun 19th, 2013, 07:57 PM
#5
Thread Starter
Member
Re: [PHP] Open new window for update
hope somebody will understand this.. thanks..
-
Jun 19th, 2013, 09:19 PM
#6
Re: [PHP] Open new window for update
Why are you echoing html? That is bad practice! PHP and html should be kept separate. What are the ids of the text boxes on the window that pops up?
when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
https://get.cryptobrowser.site/30/4111672
-
Jun 19th, 2013, 09:24 PM
#7
Thread Starter
Member
Re: [PHP] Open new window for update
sorry for my code.. maybe i will learn on how to separate HTML and PHP one of this days.
i will try to study it.
and here's my code for the pop up window:
PHP Code:
echo "<table class='original' cellspacing='1' border='0'>"; echo "<form action='ViewASUSLacking.php' method='post'>"; echo "<td class='text2' bgcolor='e3e6e5' height='40'>"."UNIT P/N:"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='UnitPN'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."MODEL:"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='Model'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."SERIAL #"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='oldSerial'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."NEW SERIAL #"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='newSerial'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."LACKING P/N"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='lackPN'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."DESCRIPTION"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='lackDesc'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."CUSTOMER"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='customer'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."LOCATION"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='location'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."RMA #"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='RMANo'>"."</td>"; echo "<tr>"; echo "<td class='text2' bgcolor='e3e6e5'>"."STATION"."</td>"."<td class='text1'bgcolor='e3e6e5' height='20'>"."<input type='text' name='station'>"."</td>"; echo "<tr>"; echo "<tr>"; echo "<tr>"; echo "<tr>"; echo "<tr>"; echo "<tr>"; echo "<td class='text1' align='right'>"."<td class='text1' align='right'><input type='submit' value='Update' name='close'>"."</td>"."</td>"; echo "</form>";
Last edited by disinwebe; Jun 20th, 2013 at 03:24 AM.
-
Jun 20th, 2013, 03:45 AM
#8
Thread Starter
Member
Re: [PHP] Open new window for update
-
Jun 20th, 2013, 04:14 AM
#9
Thread Starter
Member
Re: [PHP] Open new window for update
i see this post in JAVASCRIPT forum.
may i kindly ask how can i apply this one in my PHP project?
Thanks.
http://www.vbforums.com/showthread.p...=2#post3256067
-
Jun 29th, 2013, 10:52 AM
#10
Addicted Member
Re: [PHP] Open new window for update
Last edited by Pc Monk; Jun 29th, 2013 at 11:07 AM.
Body Language tells the truth! even from the grave tsaeb eht morf gninnur ,nwod deaH
All the big things started from little! teef my tsap evom sekans ,duol raor slluB
Lietome.ir
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|