Re: [PHP] open a secondary window/tab in the browser from php

2008-02-18 Thread Neo [GC]

No, this is not possible.

You have to do at least two requests, one to get the PDF, one to get the 
html confirmation message.


Normally you would onle open the pdf in a new window using 
target=_blank for the link. Workflow isn't broken, but you have no 
confirmation message.


There are several ways to do what you want with javascript, but without 
there is none.



julian schrieb:



Hi,

I have an application that along  filling in some forms, it produces a 
pdf file, as confirmation of all entered data.


I want to send this pdf file to a different window/tab of the browser, 
so it is displayed and can latter be printed.


In the mean time, the original window contains a confirmation message, 
to continue with the work flow.


I would like to do this without use of JavaScript

Any combination of headers ??

Any hints appreciated.

JCG



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Redirect via GET is loosing characters

2007-05-03 Thread Neo [GC]

Merlin schrieb:

Hi there,

I am checking plausability inside a php script that receives a POST 
submit. If an error occures the user should be redirected back, along 
with his original data filled into the forms.


There is a problem with this. As the GET method, which the redirect is 
using, only allows a certain amount of characters, the text is always 
cut down.


I use this:
HEADER(Location:.$data[rurl].?error=.$error.$parameter);

Is there a way to redirect the user to the form and fill in large text?

Thank you for your help,

Best regards, Merlin



This is a normal behaviour. Webservers trim the GET-request at a certain 
length.


You have several options:
- don't do a redirect but return the form, with most clean frameworks it 
should be no problem to include the action wich generates the form
- save the variables in a session, then send the redirect-header and 
clean the session after regenerating the form
- save the variables in a cookie stored at the client and clean the 
cookie afterwards (ugly)



Greetings,

--
Thomas 'Neo' Weber

Webmaster
GothNet.eu | Gothic-Chat.de

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Redirect via GET is loosing characters

2007-05-03 Thread Neo [GC]
Ah, i thought to remember that the limit is lower on IIS than on Apache, 
maybe i've just some memory faults. ;)


GET is meant to define what to GET, not to define content. This sounds a 
bit academic, but remember that the GET-args are a part of the URI and 
so will also go into the http-log for example. One don't want to have 
2kb per log-line. ;)
Additionally, please think of the great talent of users to fuck things 
up: GET-args will become bookmarks, links etc. and WILL do funny things 
when overused (session-ids...). ;)



Daniel Brown schrieb:


Beating a dead horse here, since it's been mentioned twice already, 
but yeah --- $_SESSION's are the way to go with this.


?
session_start();

$_SESSION['error'] = $error;
$_SESSION['parameter'] = $parameter;

header(Location:.$data[rurl]);
exit;
?

And wherever you have your error handling, do:
?
session_start(); // If not called from a header.php-like start file.

if($_SESSION['error']) {
// Do something with $_SESSION['error'] and $_SESSION['parameter']
}
?

And for the record, it's not just the HTTP server that trims it, but 
the browser generally does, as well, to avoid things such as memory 
leaks, et cetera.  Internet Exploder, for example, has had a limit of 
2,083 total characters in a GET request, but the actual RFC for HTTP/1.1 
has no limit for the protocol (RFC 2616 Section 3.2.1).


And slightly off-topic, but think about how much the web has changed 
in the last 20 years (well, 17, since the HTTP protocol came about in 
1990) and then think about the fact that it's all still based on 
nothing higher than version 1.1.


On 5/3/07, *Neo [GC]* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:


Merlin schrieb:
  Hi there,
 
  I am checking plausability inside a php script that receives a POST
  submit. If an error occures the user should be redirected back, along
  with his original data filled into the forms.
 
  There is a problem with this. As the GET method, which the
redirect is
  using, only allows a certain amount of characters, the text is always
  cut down.
 
  I use this:
  HEADER(Location:.$data[rurl].?error=.$error.$parameter);
 
  Is there a way to redirect the user to the form and fill in large
text?
 
  Thank you for your help,
 
  Best regards, Merlin
 

This is a normal behaviour. Webservers trim the GET-request at a
certain
length.

You have several options:
- don't do a redirect but return the form, with most clean frameworks it
should be no problem to include the action wich generates the form
- save the variables in a session, then send the redirect-header and
clean the session after regenerating the form
- save the variables in a cookie stored at the client and clean the
cookie afterwards (ugly)


Greetings,

--
Thomas 'Neo' Weber

Webmaster
GothNet.eu | Gothic-Chat.de

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



--
Thomas 'Neo' Weber

Webmaster
GothNet.eu | Gothic-Chat.de

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP/MySQL fatal error

2004-08-28 Thread gc
Please accept my appologies, it won't happen again. I didn't realize. I must
have missed this in the welcome message. 

gene

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 27, 2004 11:00 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHP/MySQL fatal error


On Saturday 28 August 2004 09:43, gc wrote:
 Hi all,

 I'm Gene Candelaria and I'm a PHP and MySQL newbie.

You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a References: header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view (tree view) of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on New message instead of Reply within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Fatal error: Call to undefined function

2004-08-28 Thread gc
Let me try this again,

I'm Gene Candelaria and I'm a PHP and MySQL newbie. I have a feeling a lot
of you may have seen this before. I'm teaching myself
PHP/MySQL and trying to setup a guestbook. I'm running latest versions of
Apache, PHP and MySql on WIN 2000. PHP is installed from the zip file. When
serving php docs (code snippets below) I get the messages:

Fatal error: Call to undefined function mysql_connect() 
Fatal error: Call to undefined function mysql_pconnect() 

I've been reading and searching and trying all sorts of things to fix this
and can't find the solution. I've removed the comment from the line
extension=php_mysql.dll in php.ini. (Below is the MySQL section of
php.ini. It's pretty standard, I'm using defaults.) I edited my Apache
config file with the needed lines:

### Section 4: PHP 5 Module
#
ScriptAlias /cgi-bin/ C:/Program Files/Apache
Group/Apache2/cgi-bin/
LoadModule php5_module php/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir C:/Program Files/Apache Group/Apache2/PHP

When I run phpinfo, MySQL is not listed. Do I need to enable it in the
configure command? How do I edit the configure command. Per phpinfo, It now
reads:

Configure Command cscript /nologo configure.js --with-gd=shared
--enable-snapshot-build 

I read these comments: 

Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but
is
mysql really enabled? Does your configure command look something
like
this?
'./configure'
'--with-mysql=/usr/local/mysql'

If you don't have --with-mysql it means that you cannot use mysql
functions,
so compile PHP again with this option.


How do I edit that pesky configure command. I searched, but couldn't find an
answer. So, where am I going wrong? Thanks for reading and big thanks for
any help.

gene
[EMAIL PROTECTED]


php.ini snippet (comments removed for easier reading:
[MySQL]
mysql.allow_persistent = On
mysql.max_persistent = -1
mysql.max_links = -1
mysql.default_port =
mysql.default_socket =
mysql.default_host =
mysql.default_user =
mysql.default_password =
mysql.connect_timeout = 60
mysql.trace_mode = Off 


guest.php code snippet:
//connect 
// change localhost to your db host name 
mysql_pconnect( http://aulon.dyndns.org/;, $username, $password) 
or die( Unable to connect to SQL server); 
mysql_select_db( $db_name) or die( Unable to select database); 
guestbook.php code snippet:
// Connect to DB
$li = mysql_connect($dbHost, $dbUser, $dbPass) or die(Could not connect);
mysql_select_db($dbDatabase, $li) or die (could not select DB); 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Fatal error: Call to undefined function

2004-08-28 Thread gc
Thanks, John. I have the line uncommented, am editing php.ini in my winnt
directory and have restarted the server. No magic, yet. 

Thanks again.
g

-Original Message-
From: John Nichel

gc wrote:
snip-a-roo

It's been awhile since I've done php on Windows, but I think you have to 
uncomment the mysql dll in the php.ini file (make sure you're editing 
the right one as per phpinfo), and restart your web server.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Fatal error: Call to undefined function

2004-08-28 Thread gc
Thanks for the help, Phollip. Yes, I did read and follow the instructions in
the manual and the faq. I did edit my path and restarted my system. Same
result.

g

-Original Message-
From: Philip Olson [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 28, 2004 7:11 PM
To: gc
Cc: [EMAIL PROTECTED]
Subject: RE: [PHP] Fatal error: Call to undefined function


  It's been awhile since I've done php on Windows, but I think 
  you have to uncomment the mysql dll in the php.ini file (make 
  sure you're editing the right one as per phpinfo), and restart 
  your web server. 

 Thanks, John. I have the line uncommented, am editing php.ini in my winnt
 directory and have restarted the server. No magic, yet. 

And make sure libmysql.dll is available in your systems PATH
and a nice way to do that is adding the PHP dir to your PATH
but a less cool way would be to copy libmysql.dll into the
Windows sytem directory because that directory is in the
PATH.  Don't do that though..

The manual talks about all of this, read the installation
section:

  http://php.net/manual/en/install.windows.manual.php

It says how to set your PATH (via system environmetn variables)
and the MySQL documentation also refers to all of this:

  http://www.php.net/mysql

Both of the above manual pages link to related FAQs so read
those as well.

Regards,
Philip

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP/MySQL fatal error

2004-08-27 Thread gc
Hi all,

I'm Gene Candelaria and I'm a PHP and MySQL newbie.

I have a feeling a lot of you have seen this before. I'm teaching myself
PHP/MySQL trying to setup a guestbook. I'm running latest versions of
Apache, PHP and MySql on my WIN2k machine. I have them working, except, I
get the messages:

Fatal error: Call to undefined function mysql_connect() 

Fatal error: Call to undefined function mysql_pconnect() 

when serving two of my php docs (code snippets below). I've been reading and
searching and trying all sorts of things to fix this and nothing works. I've
removed the comment from the line extension=php_mysql.dll in php.ini.
(Below is the MySQL section of php.ini. It's pretty standard, I'm using
defaults.) I edited my Apache config file with the needed lines:

 
### Section 4: PHP 5 Module
#
ScriptAlias /cgi-bin/ C:/Program Files/Apache Group/Apache2/cgi-bin/
LoadModule php5_module php/php5apache2.dll
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
PHPIniDir C:/Program Files/Apache Group/Apache2/PHP


When I run my test.php doc, MySQL is not listed. Do I need to enable it in
the configure command? How do I edit the configure command. Per my test.php,
It now reads:

Configure Command  cscript /nologo configure.js --with-gd=shared
--enable-snapshot-build 
  

Online I read these comments: 
 
Ok, your php.ini file is set to 'on' for mysql.allow_persistent, but is
mysql  really enabled? Does your configure command look something like
this?
'./configure' '--with-mysql=/usr/local/mysql'

If you don't have --with-mysql it means that you cannot use mysql functions,
so compile PHP again 
with this option.



How do I edit that pesky configure command. I searched, but couldn't find an
answer. So, where am I going wrong? Thanks for reading and big thanks for
any help.
 
gene
[EMAIL PROTECTED]



 
php.ini snippet (comments removed for easier reading:

[MySQL]

mysql.allow_persistent = On
 
mysql.max_persistent = -1
 
mysql.max_links = -1

mysql.default_port =
 
mysql.default_socket =

mysql.default_host =

mysql.default_user =
 
mysql.default_password =

mysql.connect_timeout = 60

mysql.trace_mode = Off 



guest.php code snippet:

//connect 
// change localhost to your db host name 
mysql_pconnect( http://aulon.dyndns.org/;, $username, $password) 
   or die( Unable to connect to SQL server); 
mysql_select_db( $db_name) or die( Unable to select database); 
 
 
guestbook.php code snippet:

// Connect to DB

$li = mysql_connect($dbHost, $dbUser, $dbPass) or die(Could not connect);
mysql_select_db($dbDatabase, $li) or die (could not select DB); 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] _POST _GET

2002-11-11 Thread GC
Hi-
Can I use both _GET and _POST in the same php file?  Thanks!!
-Greg



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] PHP WebDAV

2002-11-01 Thread GC
I'm using WebDAV in Apache 2, whenever I try to get an html file it works
fine, but when I try to get a PHP file I get an error saying it cannot get
filename.php.  How come I can only get html files through WebDAV?  Is there
a way to change this?  Thanks!!



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] php / ldap

2002-10-30 Thread GC
Hi, using php_ldapadd, I get this error in ldap.log:

Oct 30 09:23:43 Lunar slapd[10714]: conn=202 op=1 RESULT tag=105 err=65
text=object class 'posixAccount' requires attribute 'uidNumber'

How do I get the next available uid number from my ldap database and then
use that number for uidnumber?
Thanks!!
-Greg



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] ldap_add problem

2002-10-24 Thread GC
Hi, I wrote a simple page that tries to enter a string into a LDAP server.
I get the following error:

Warning: LDAP: add operation could not be completed. in
/var/www/html/user/adduser_p.php on line 65

Where in my log files can I go to look for more detailed info on that error,
I don't know if I have logging enabled for slapd.  Thanks!!
-GC



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php