php-general Digest 30 Aug 2012 07:57:11 -0000 Issue 7943

Topics (messages 318923 through 318927):

Re: PHP to XLS Security Alert issue
        318923 by: Jim Lucas

Re: OT (maybe not): Drupal vs WordPress
        318924 by: tamouse mailing lists

Help with MSSQL and Stored Procs
        318925 by: Phillip Baker
        318926 by: Andrew Ballard

Re: multiple forms one page
        318927 by: Rosie Williams

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On 08/29/2012 10:28 AM, admin wrote:
-----Original Message-----
From: Matijn Woudt [mailto:tijn...@gmail.com]
Sent: Tuesday, August 28, 2012 3:55 PM
To: admin
Cc: php-gene...@lists.php.net
Subject: Re: [PHP] PHP to XLS Security Alert issue

I believe that's normal, and that it does that with any document downloaded 
from the web.
I'm not sure if there's a workaround, but you should not ask that here but on a 
Microsoft Office forum/list, or just ask the question to Microsoft themselves.

- Matijn

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


Matijn,
        I understand YOU believe this is normal.
I am sorry you feel that way because the construction of the document is 
exactly where the problem was resolved, and that is in PHP.
So asking in the PHP-List was the exact the place to post a question of 
document construction using PHP. Yes understanding the document verification 
methods of Microsoft helps but it is up to the DEVELOPER to put the correct 
headers and content strings to make the document valid and that is what I was 
asked.

Q: I am exporting to a XLS file and the file does export, but when I open the 
file Microsoft is giving a Excel Security Notice. I am sure there is something 
in the header that is missing or causing this problem?

If I create a file using MS Excel, I get this message if I screw up some data in one of the fields. If it has a formula in one of the cells that it doesn't like, then it complains. May want to check that as well.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

--- End Message ---
--- Begin Message ---
On Tue, Aug 28, 2012 at 3:36 PM, Adam Richardson <simples...@gmail.com> wrote:
> On Tue, Aug 28, 2012 at 3:07 PM, Larry Garfield <la...@garfieldtech.com> 
> wrote:
>> Only semi-joking line that's been making the rounds lately:
>>
>> If you want to build a blog, use Wordpress.
>> If you want to build Wordpress, use Drupal.
>> If you want to build Drupal, use Symfony2.
>
> Here's another semi-joking line :)
>
> If build a blog using Wordpress, build Wordpress using Drupal, build a
> Drupal using Symfony2, I'd feel the same way I feel after drinking
> several beers, eating a pizza, snacking on some hot wings, and
> polishing it all off with a banana split: bloated :)
>
> Adam
>
> --
> Nephtali:  A simple, flexible, fast, and security-focused PHP framework
> http://nephtaliproject.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Is that the analog to Sagan's "how to make an apple pie" ?

--- End Message ---
--- Begin Message ---
I am trying to access a MSSQL DB on another system.
I am having trouble executed a stored proc and debugging the problem./

I have included the code below.
I can connect to the DB just fine.
I also can run regular queries on the DB and get a result set.
We can also run the stored proc manually with the data in $xmlstring and
that runs fine.

However the mssql_execute is failing.
I am getting the Execute failed die message however I am not getting
anything for mssql_get_last_message

So I have no idea what is happening.
And ideas for solutions or at least to get more debugging information would
be awesome.

I know SQLSRV is a more recent option however we do not have it installed
on the server and will likely not get that to happen so I need to get this
debugged.

$link = mssql_connect($myServer, $myUser, $myPass)
    or die("Couldn't connect to SQL Server on $myServer");
mssql_select_db($myDB, $link)
    or die("Couldn't select database $myDB");
if(!$link){
    die('Error connecting to MSSQL database at '.$myServer);
} else {
    $version = mssql_query('SELECT @@VERSION');
    $row = mssql_fetch_array($version);
    mssql_free_result($version);

    echo $row[0].'<br /><br />';
}
$storedproc = "Sp_DialerValidLead";
$param = "ValidLeadText";

$stmt = mssql_init('Sp_DialerValidLead', $link)
or die("Unable to initialize");

mssql_bind($stmt, "@".$param, $xmlstring, SQLVARCHAR)
    or die("Unable to bind
@ValidLeadText:$storedproc<br>".mssql_get_last_message());

$result = mssql_execute($stmt)
    or die ("Execute failed. Message:".mssql_get_last_message());

var_dump($result);


Blessed Be

Phillip

"In the Jim Crow South, for example, government failed and indeed refused
to protect blacks from extra-legal violence. Given our history, it's
stunning we fail to question those who would force upon us a total reliance
on the state for defense."
-- Robert J. Cottrol

--- End Message ---
--- Begin Message ---
On Wed, Aug 29, 2012 at 3:14 PM, Phillip Baker <phil...@freewolf.net> wrote:
> I am trying to access a MSSQL DB on another system.
> I am having trouble executed a stored proc and debugging the problem./
>
> I have included the code below.
> I can connect to the DB just fine.
> I also can run regular queries on the DB and get a result set.
> We can also run the stored proc manually with the data in $xmlstring and
> that runs fine.
>
> However the mssql_execute is failing.
> I am getting the Execute failed die message however I am not getting
> anything for mssql_get_last_message
>
> So I have no idea what is happening.
> And ideas for solutions or at least to get more debugging information would
> be awesome.
>
> I know SQLSRV is a more recent option however we do not have it installed
> on the server and will likely not get that to happen so I need to get this
> debugged.
>
> $link = mssql_connect($myServer, $myUser, $myPass)
>     or die("Couldn't connect to SQL Server on $myServer");
> mssql_select_db($myDB, $link)
>     or die("Couldn't select database $myDB");
> if(!$link){
>     die('Error connecting to MSSQL database at '.$myServer);
> } else {
>     $version = mssql_query('SELECT @@VERSION');
>     $row = mssql_fetch_array($version);
>     mssql_free_result($version);
>
>     echo $row[0].'<br /><br />';
> }
> $storedproc = "Sp_DialerValidLead";
> $param = "ValidLeadText";
>
> $stmt = mssql_init('Sp_DialerValidLead', $link)
> or die("Unable to initialize");
>
> mssql_bind($stmt, "@".$param, $xmlstring, SQLVARCHAR)
>     or die("Unable to bind
> @ValidLeadText:$storedproc<br>".mssql_get_last_message());
>
> $result = mssql_execute($stmt)
>     or die ("Execute failed. Message:".mssql_get_last_message());
>
> var_dump($result);
>
>
> Blessed Be
>
> Phillip

I had to go to an old server that we are phasing out to find something
that had php_mssql installed on it, but once I got everything set up
it everything worked fine for me. I tested it with everything correct
as well as with a variety of forced errors (procedure doesn't exist,
user does not have permission to execute, parameter name different
than passed by PHP, etc.) and they all displayed error messages using
the code you posted above.

The server is running PHP 5.2.12, and this one can only connect to our
SQL Server 2000 instance, so I can't test it against SQL 2008.

Andrew

--- End Message ---
--- Begin Message ---
Hi all, 
I'd like to thank Adam, Ted & Tamara for their welcome and help. I'm working on 
getting my site presentable (and secure!) so that I can post the code & url 
more publicly for my future questions.
regardsRosie
                                          

--- End Message ---

Reply via email to