473,505 Members | 15,036 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

form action to same file opens new window

Two questions late at night and going stir crazy. Anybody who takes pity on
me will have my undying gratitude and a virtual bottle of beer.
I've tried to look them both up on the php.net, and elsewhere, but without
success.

1. Am writing a php program which checks entries in a form on a previous
page. It then asks for any empty fields to be filled, and submits the
resulting form back to itself to check it again.

In other words the file "checkblank.php" includes this line within the php:

echo "<form target=\"checkblank.php\" method=\"post\">";

When the form is submitted it opens in a new window (in FireFox). In Firefox
it is not a disaster as the variables and arrays are not lost, and the
program works, but popups are not something I like. In IE the whole thing
collapses in a heap as the variables appear not to be passed to the new
window. Needless to say, the vast majority of users will have IE. Is there a
reason I'm unaware of, and can it be stopped easily?

2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
fine with variables, but converts arrays to variables. I'd like to use it
for the sake of security though. I don't particularly want to translate the
array into a whole lot of variables, as it's a big array.

Thanks
JB

Jul 17 '05 #1
6 2742
In article <6Y*****************@read1.cgocable.net>, Jo*@Blow.com says...
echo "<form target=\"checkblank.php\" method=\"post\">";
echo '<form action="checkblank.php" method="post">';

<cue doh!>
2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
fine with variables, but converts arrays to variables. I'd like to use it
for the sake of security though. I don't particularly want to translate the
array into a whole lot of variables, as it's a big array.


Have used a call to a user-defined function within array_walk to alter all
values in an array, can't see why you could do it also with inbuilt
functions like strip_tags but I haven't tried it out.

Geoff M
Jul 17 '05 #2
Joe Blow (Jo*@Blow.com) decided we needed to hear...
Two questions late at night and going stir crazy. Anybody who takes pity on
me will have my undying gratitude and a virtual bottle of beer.
I've tried to look them both up on the php.net, and elsewhere, but without
success.

1. Am writing a php program which checks entries in a form on a previous
page. It then asks for any empty fields to be filled, and submits the
resulting form back to itself to check it again.

In other words the file "checkblank.php" includes this line within the php:

echo "<form target=\"checkblank.php\" method=\"post\">"; instead, use...
echo "<form action='checkblank.php' method='post' target='_self'>";

When the form is submitted it opens in a new window (in FireFox). In Firefox
it is not a disaster as the variables and arrays are not lost, and the
program works, but popups are not something I like. In IE the whole thing
collapses in a heap as the variables appear not to be passed to the new
window. Needless to say, the vast majority of users will have IE. Is there a
reason I'm unaware of, and can it be stopped easily?

2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
fine with variables, but converts arrays to variables. I'd like to use it
for the sake of security though. I don't particularly want to translate the
array into a whole lot of variables, as it's a big array.

something like...
foreach (array_keys($array_to_strip) as $akey) {
$array_to_strip[$akey] = strip_tags($array_to_strip[$akey]);
}
or use array_walk or array_walk_recursive

--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)
Jul 17 '05 #3
Many thanks indeed.
"Dave" <da**@REMOVEbundook.com> wrote in message
news:2e************@fawlty.homelinux.net...
Joe Blow (Jo*@Blow.com) decided we needed to hear...
Two questions late at night and going stir crazy. Anybody who takes pity
on
me will have my undying gratitude and a virtual bottle of beer.
I've tried to look them both up on the php.net, and elsewhere, but
without
success.

1. Am writing a php program which checks entries in a form on a previous
page. It then asks for any empty fields to be filled, and submits the
resulting form back to itself to check it again.

In other words the file "checkblank.php" includes this line within the
php:

echo "<form target=\"checkblank.php\" method=\"post\">";

instead, use...
echo "<form action='checkblank.php' method='post' target='_self'>";

When the form is submitted it opens in a new window (in FireFox). In
Firefox
it is not a disaster as the variables and arrays are not lost, and the
program works, but popups are not something I like. In IE the whole thing
collapses in a heap as the variables appear not to be passed to the new
window. Needless to say, the vast majority of users will have IE. Is
there a
reason I'm unaware of, and can it be stopped easily?

2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
fine with variables, but converts arrays to variables. I'd like to use it
for the sake of security though. I don't particularly want to translate
the
array into a whole lot of variables, as it's a big array.

something like...
foreach (array_keys($array_to_strip) as $akey) {
$array_to_strip[$akey] = strip_tags($array_to_strip[$akey]);
}
or use array_walk or array_walk_recursive

--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)

Jul 17 '05 #4
"Dave" <da**@REMOVEbundook.com> wrote in message
news:2e************@fawlty.homelinux.net...
Joe Blow (Jo*@Blow.com) decided we needed to hear...
Two questions late at night and going stir crazy. Anybody who takes pity
on
me will have my undying gratitude and a virtual bottle of beer.
I've tried to look them both up on the php.net, and elsewhere, but
without
success.

1. Am writing a php program which checks entries in a form on a previous
page. It then asks for any empty fields to be filled, and submits the
resulting form back to itself to check it again.

In other words the file "checkblank.php" includes this line within the
php:

echo "<form target=\"checkblank.php\" method=\"post\">";

instead, use...
echo "<form action='checkblank.php' method='post' target='_self'>";

When the form is submitted it opens in a new window (in FireFox). In
Firefox
it is not a disaster as the variables and arrays are not lost, and the
program works, but popups are not something I like. In IE the whole thing
collapses in a heap as the variables appear not to be passed to the new
window. Needless to say, the vast majority of users will have IE. Is
there a
reason I'm unaware of, and can it be stopped easily?

2. Can anybody suggest a quick and easy way to strip arrays? stip_tags is
fine with variables, but converts arrays to variables. I'd like to use it
for the sake of security though. I don't particularly want to translate
the
array into a whole lot of variables, as it's a big array.

something like...
foreach (array_keys($array_to_strip) as $akey) {
$array_to_strip[$akey] = strip_tags($array_to_strip[$akey]);
}
or use array_walk or array_walk_recursive

--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)


By the way, I am using a really terrible and out of date book as a guide
while I get familiar with PHP. It's led me astray a few times.

According to it, there is no difference between ' and \". Does it have an
effect? Or am I missing something in the HTML?

JB
Jul 17 '05 #5
Joe Blow (Jo*@Blow.com) decided we needed to hear...
<snip>
By the way, I am using a really terrible and out of date book as a guide
while I get familiar with PHP. It's led me astray a few times.

According to it, there is no difference between ' and \". Does it have an
effect? Or am I missing something in the HTML?

JB

AFAIK for plain HTML there isn't a difference between single and double
quotes - as long as they're used consistently - I just prefer single.
As far as PHP is concerned using one or the other determines (amongst
other things) if vars will be interpolated. I tend to use single quotes
by default, until double are required.
You can read all of the gory details(!) here:
http://www.php.net/manual/en/language.types.string.php
--
Dave <da**@REMOVEbundook.com>
(Remove REMOVE for email address)
Jul 17 '05 #6
Oh boy, I was having a bad night last night.

I have only just realised that I had '<form action=...' instead of <form
target='.

D'oh indeed.

JB

Jul 17 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1625
by: John Floria | last post by:
Hello, I have several links on my page that run reports. Each link submits a seperate form. The onclick event of the link opens a new named window where I control the "chrome". The form's...
1
3748
by: Display Name | last post by:
the customer I'm developing a site for uses a canned form-parsing page that allows her to have an email subscription opt-in page add emails to a list she can manage using a link that you point your...
8
1710
by: TNGgroup | last post by:
Hi, Question, I have a simple form and want to submit a selected value of a combo box. so my combo box is named "selectname" and my form has action="file.asp?" what do I have to put after the...
32
2444
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
13
2125
by: Geoff Cox | last post by:
Hello, How do I create a form without using document.write() which opens a new window? I imagine it has to do with using a <SPAN ID='idvalue' etc element and...
1
1714
by: Andy Kasotia | last post by:
I have an ASP UI with VB Dll as a COM object that access the DB2 Database. I have a "Calculate" button on the ASP Page which when clicked does form validation (javascript) and submits the form...
6
2842
by: dbuchanan | last post by:
VS2005 I've been reading all the help I can on the topic (MSDN, other) but I can't make sense of this. Desired behavior; The user is to choose from the displayed list of the databound combobox...
4
2042
by: =?Utf-8?B?S29sbG1vcmdlbg==?= | last post by:
I have an asp page that outputs a word document. Wnen the user attempts to open this page from a hyberlink in an email document the word document opens fine but if they save then an action...
3
2546
by: paviktherin | last post by:
Okay so I have this form that I have made in order to post comments on a website, the form works fine when I send it to guernica.php for example but it opens it in a new page, I don't know why. Then...
0
7216
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7303
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7018
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7471
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1528
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.