php-general Digest 4 Jun 2005 13:15:23 -0000 Issue 3493

Topics (messages 216354 through 216369):

Help with some OOP
        216354 by: JamesBenson

Re: autocomplete a field
        216355 by: xfedex
        216366 by: Rory Browne

mozilla & urlencode
        216356 by: John Taylor-Johnston
        216357 by: Sebastian
        216358 by: John Taylor-Johnston
        216359 by: Pablo Gosse
        216362 by: JamesBenson
        216365 by: Marek Kilimajer

missing $_GET
        216360 by: Ric Manalac
        216361 by: JamesBenson

about PHP Graphic .
        216363 by: NeginGostar.com :: Administrator

Deerpark (aka Firefox 1.1 alpha) URI's and PHP
        216364 by: Chris Drozdowski

Returned mail: Data format error
        216367 by: Post Office

Re: Exporting to MS Word or Excel
        216368 by: Rory Browne

Re: htmlArea - a 'client editor'
        216369 by: M Saleh EG

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message --- Hello all, Ive been working with PHP for my websites for a few months, just attempted to build my own class, after reading all this stuff about automated robots and XSS attacks etc decided to step up security a bit, my result is an attempt to create a class for using the token method within web forms, not even sure whether its the real thing but my work is below, some advice on whether its ok or what needs improving would be appreciated, thanks.


<?php
// PHP 4.3.11


class SecretToken {

    var $_returnCode;


    function GenerateToken() {
     if(!isset($_SESSION['token'])) {
      session_regenerate_id();
      $new_token = md5(uniqid(rand(), true));
      $_SESSION['token'] = $new_token;
     }
    }


    function VerifyToken($post) {
     if(isset($_SESSION['token'])) {
      $saved_token = ($_SESSION['token']);
     }
     if($post == $saved_token):
      $this->_returnCode = 1;
      unset($_SESSION['token']);
     else:
      $this->_returnCode = 0;
     endif;
    }


    function ReturnCode() {
## Result will be 1 for success or 0 for fail
      return $this->_returnCode;
    }


// end class definition
}
?>


Basically in my web form I call GenerateToken firstly, then when the forms been submitted I then call VerifyToken and finally check return codes using a switch statement, seems to work,


TIA
James Benson

--- End Message ---
--- Begin Message ---
Hi,

Anyone know if theres a way to disable this feature for user using old 
browsers or not suporting JS/XML?

Thanks,
pancarne.

--- End Message ---
--- Begin Message ---
On 6/4/05, xfedex <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> Anyone know if theres a way to disable this feature for user using old
> browsers or not suporting JS/XML?
Put your JS Code in html comments, like as follows.......
<script .......>
<!--
JS_CODE_HERE()
//-->
</script>




> 
> Thanks,
> pancarne.
> 
>

--- End Message ---
--- Begin Message ---
I seem to have a problem with Mozilla or with IE?

echo "<a name=\"".urlencode($mydata->district)."\"></a>";
<a name="Montr%E9al+District+%234"></a>

http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in IE6, but Mozilla will not accept it.

Mozilla does not work. Am I approaching this wrong? Should I create my HTML this way?

echo "<a name=\"".$mydata->district."\"></a>";
<a name="Montr�al District #4"></a>

If I do, Mozilla prferes this:

http://foo.org/_private/directory.php#Montr%E9al%20District%20#4
or
http://foo.org/_private/directory.php#Montr%E9al%20District%20%234

IE refuses it and prefers:

http://foo.org/_private/directory.php#Montr%E9al+District+%234

What's my work around? Complain to Mozilla? Same for Firefox BTW. I cannot change my field.
--- End Message ---
--- Begin Message ---
i dont think having a + in an achor tag is standard.. but i could be wrong.

John Taylor-Johnston wrote:

I seem to have a problem with Mozilla or with IE?

echo "<a name=\"".urlencode($mydata->district)."\"></a>";
<a name="Montr%E9al+District+%234"></a>

http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in IE6, but Mozilla will not accept it.

Mozilla does not work. Am I approaching this wrong? Should I create my HTML this way?

echo "<a name=\"".$mydata->district."\"></a>";
<a name="Montr�al District #4"></a>

If I do, Mozilla prferes this:

http://foo.org/_private/directory.php#Montr%E9al%20District%20#4
or
http://foo.org/_private/directory.php#Montr%E9al%20District%20%234

IE refuses it and prefers:

http://foo.org/_private/directory.php#Montr%E9al+District+%234

What's my work around? Complain to Mozilla? Same for Firefox BTW. I cannot change my field.


--- End Message ---
--- Begin Message --- I sent this to Mozilla groups. I'm beginning to wonder if Mozilla supports <a name="">?
I think re-asked my question clearer below.
John

i dont think having a + in an achor tag is standard.. but i could be wrong.

I'm truly hoping this is a reported bug already.

This URL does not work in most recent upgrades of Mozilla or FF:

http://www.glquebec.org/_private/directory.php#District+of+St.+Francis

I generate the link using PHP:

   if ("" != $mydata->district){
echo " - <a href=\"#".urlencode($mydata->district)."\">$mydata->district</a></h1>";
   }else{
   echo "</h1>";
   }

The link is named:

echo "<hr size=1><a name=\"".urlencode($mydata->district)."\"></a><h2>$mydata->district</h2>\n";

Unless you're going to tell me <a name=""> is outdated, (it is kind of in xhtml) there is a bug!
Otherwise, how do I name an anchor now?

This works in IE6, even in NS4.8 but not Moz or FF. What's up Moz?

http://www.glquebec.org/_private/directory.php#District+of+St.+Francis

--- End Message ---
--- Begin Message ---
<snip>
echo "<a name=\"".urlencode($mydata->district)."\"></a>";
<a name="Montr%E9al+District+%234"></a>

http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in 
IE6, but Mozilla will not accept it.

Mozilla does not work. Am I approaching this wrong? Should I create my 
HTML this way?

echo "<a name=\"".$mydata->district."\"></a>";
<a name="Montr�al District #4"></a>

If I do, Mozilla prferes this:

http://foo.org/_private/directory.php#Montr%E9al%20District%20#4
or
http://foo.org/_private/directory.php#Montr%E9al%20District%20%234

IE refuses it and prefers:

http://foo.org/_private/directory.php#Montr%E9al+District+%234
</snip>

I'm not sure, but I see two things that might be causing this.  First, why are 
spaces, which should be translated as %20, being represented as a '+'?

Second, you have a # in the actual bookmark name, which I would assume is not 
valid since the # denotes the beginning of a bookmark.  So perhaps IE 
compensates for this, but Mozilla reads the bookmark as looking for <a 
name="4"></a> because of the #4 at the end of the bookmark name.

HTH,

Pablo

--- End Message ---
--- Begin Message ---

Your code is wrong, there is nothing wrong with Firefox's support for anchor tags (that im aware of) and IE dont do too badly with them either. Paste the following into a blank HTML file
Shoule work...does for me, no problem.




<html><head><title></title></head><body>

<a href="#test%20link">click me</a>

<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />

<a name="test%20link">Ha, you clicked me, should work in Firefox 1.0.4 (Linux)</a>

</body></html>








Im sure its just the �
Above works but not with an � (dont have IE) which leads me to think you should use the equivalent of the �


HTH
James

--- End Message ---
--- Begin Message ---
John Taylor-Johnston wrote:
I seem to have a problem with Mozilla or with IE?

echo "<a name=\"".urlencode($mydata->district)."\"></a>";
<a name="Montr%E9al+District+%234"></a>

http://foo.org/_private/directory.php#Montr%E9al+District+%234 works in IE6, but Mozilla will not accept it.

Mozilla does not work. Am I approaching this wrong? Should I create my HTML this way?

echo "<a name=\"".$mydata->district."\"></a>";
<a name="Montr�al District #4"></a>

If I do, Mozilla prferes this:

http://foo.org/_private/directory.php#Montr%E9al%20District%20#4
or
http://foo.org/_private/directory.php#Montr%E9al%20District%20%234

IE refuses it and prefers:

http://foo.org/_private/directory.php#Montr%E9al+District+%234

What's my work around? Complain to Mozilla? Same for Firefox BTW. I cannot change my field.


name attribute if type CDATA, so it should not be urlencoded, but htmlspecialchars used instead.

But this is not necessery because of other restrictions for name and id attributes:

http://www.w3.org/TR/REC-html40/types.html#type-cdata

--- End Message ---
--- Begin Message ---
Hello,

I've encountered a weird problem with using $_GET. I've recently moved
to a new hosting company and an old code suddenly stopped working
correctly.

>From my index page, I pass a value through the querystring to another
PHP script. The querystring parameter goes like ?catid=500.

In the script that attempts to get the value, I have the following code:

if (isset($_GET["catid"]))
{
   $catid = $_GET["catid"];
}
else
{
   $catid = 1;
}

What used to happen was $catid is assigned the value of $_GET["catid"]
if the catid parameter is passed through the querystring. But what
happens now is $catid is always set to 1 because $_GET["catid"] seems
to be always blank now. I've already tried removing the "isset()
check" and went directly assigning the value as such:

$catid = $_GET["catid"];

... but it still returned a blank value. What's happening to my
$_GET values? 

I hope someone can help. Is this something that can be
fixed by changing some configuration on the server? Is there something
that I need to change with my code?

Thanks!

Ric

--- End Message ---
--- Begin Message --- Possibly the PHP version your using, try looking at the PHP manual and also getting your PHP version by placing <? phpinfo(); ?> into a file and running it in your browser, see this document for other methods:-

http://php.net/manual/en/reserved.variables.php#reserved.variables.get





Ric Manalac wrote:
Hello,

I've encountered a weird problem with using $_GET. I've recently moved
to a new hosting company and an old code suddenly stopped working
correctly.

From my index page, I pass a value through the querystring to another
PHP script. The querystring parameter goes like ?catid=500.

In the script that attempts to get the value, I have the following code:

if (isset($_GET["catid"]))
{
   $catid = $_GET["catid"];
}
else
{
   $catid = 1;
}

What used to happen was $catid is assigned the value of $_GET["catid"]
if the catid parameter is passed through the querystring. But what
happens now is $catid is always set to 1 because $_GET["catid"] seems
to be always blank now. I've already tried removing the "isset()
check" and went directly assigning the value as such:

$catid = $_GET["catid"];

... but it still returned a blank value. What's happening to my
$_GET values?
I hope someone can help. Is this something that can be
fixed by changing some configuration on the server? Is there something
that I need to change with my code?

Thanks!

Ric

--- End Message ---
--- Begin Message ---
Hello Dear
I want know about PHP Graphic .
I want use graphic in php but i cant setup GD library , in my server
My Server is Windows 2003
and i want install graphic in php

please help me,
thanks

--- End Message ---
--- Begin Message --- Will PHP scripts that work properly with the current version (1.0.4) of Firefox need to be modified for the feature detailed below in Firefox 1.1?

See:
http://www.mozilla.org/projects/deerpark/new-web-dev-features.html

"URIs always sent as UTF8

URIs are now always sent to the server as UTF8, regardless of the linking page's encoding. This fixes images and links on sites with non-ASCII filenames."

Thanks,

C Drozdowski

--- End Message ---
--- Begin Message ---
ALERT!

This e-mail, in its original form, contained one or more attached files that 
were infected with a virus, worm, or other type of security threat. This e-mail 
was sent from a Road Runner IP address. As part of our continuing initiative to 
stop the spread of malicious viruses, Road Runner scans all outbound e-mail 
attachments. If a virus, worm, or other security threat is found, Road Runner 
cleans or deletes the infected attachments as necessary, but continues to send 
the original message content to the recipient. Further information on this 
initiative can be found at http://help.rr.com/faqs/e_mgsp.html.
Please be advised that Road Runner does not contact the original sender of the 
e-mail as part of the scanning process. Road Runner recommends that if the 
sender is known to you, you contact them directly and advise them of their 
issue. If you do not know the sender, we advise you to forward this message in 
its entirety (including full headers) to the Road Runner Abuse Department, at 
[EMAIL PROTECTED]

The original message was received at Sat, 4 Jun 2005 08:27:41 -0400
from lists.php.net [147.254.1.112]

----- The following addresses had permanent fatal errors -----
[email protected]

----- Transcript of session follows -----
... while talking to host 18.188.115.129:
>>> DATA
<<< 400-aturner; -RMS-E-CRE, ACP file create failed
<<< 400

file attachment: fjeqkvs.zip

This e-mail in its original form contained one or more attached files that were 
infected with the [EMAIL PROTECTED] virus or worm. They have been removed.
For more information on Road Runner's virus filtering initiative, visit our 
Help & Member Services pages at http://help.rr.com, or the virus filtering 
information page directly at http://help.rr.com/faqs/e_mgsp.html. 

--- End Message ---
--- Begin Message ---
On 6/3/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> To export it exactly as displayed (like when you print to a virtual printer 
> to generate a PDF) might be tricky, but you can definitely create Excel and I 
> believe Word files without even having Excel or Word installed.   If you DO 
> have Excel or Word installed on your server, then you can always use a COM 
> connection to handle this.
He's using LAMP, in which case the 'L' stands for Linux. Therefore he
can't have Word or Excel installed, nor can he use OLE or COM.

You might be able to rig up something with Uno/OOo(and if you do I'd
like to see your code), but I've absolutely no experience with Uno,
and very little with OOo.

Alternatively if  you can find a way to create RTF's, you can AFAIK
pass them off as word docs, by passing the correct header. you can
IIRC do something similar by creating csv's and passing an Excel
Header file.


> 
> First, maybe check out the Excel Writer PEAR package.  Here's a link to a 
> post I made about it a while ago with instructions on how to install it:
> 
> http://marc.theaimsgroup.com/?l=php-general&m=111409575703230&w=2
> 
> Excel Writer uses another PEAR package called OLE which is used to generate 
> older format MS Office files in general.  Both can be found at 
> http://pear.php.net
> 
> 
> Also, try searching the archives, I know this question has been asked many 
> times (even recently) and I'm sure you'll find some good stuff in there.
> 
> PHP-General archives:
> http://marc.theaimsgroup.com/?l=php-general
> 
> PHP-Windows archives:
> http://marc.theaimsgroup.com/?l=php-windows
> 
> PHP-Databases archives (never know eh?):
> http://marc.theaimsgroup.com/?l=php-db
> 
> And of course, the links to all these can be found on the PHP mailing lists 
> page:
> http://www.php.net/mailing-lists.php
> 
> 
> Good luck!
> 
> -TG
> 
> 
> = = = Original message = = =
> 
> Hi!!!
> 
> Are there any chances that I could export a dynamic created web page into MS
> Word or Excel?
> I know this can be done with PDF!!
> 
> I'm using LAMP!!
> 
> -----------------------
> Miguel Guirao Aguilera
> Logistica R8 TELCEL
> Tel. (999) 960.7994
> Cel. 9931 600.0000
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> ___________________________________________________________
> Sent by ePrompter, the premier email notification software.
> Free download at http://www.ePrompter.com.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

--- End Message ---
--- Begin Message ---
www.FCKEditor.net <http://www.FCKEditor.net>
FCKEditor is the best i've ever seen. 
Check it out.
 
 On 6/3/05, Rory Browne <[EMAIL PROTECTED]> wrote: 
> 
> htmlArea afaik only works on MSIE 5+. It doesn't work on 
> Mozilla/Firefox/etc.
> 
> On 6/3/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> > Ryan A:
> > Do you mean htmlArea?
> >
> > http://www.dynarch.com/projects/htmlarea/
> >
> > .. we used htmlArea in one of our projects and were quite happy with the 
> simple user interface. It had a couple of bugs ... but maybe the newer 
> release has squashed these? Check with the developer.
> >
> > Rob.
> > http://www.globalissa.com
> > _________________________
> > Ryan A wrote:
> > Hey guys (and girl...as we have one on the list...(that i know of)),
> > snip
> > 2nd question
> > I will need a kind of "client editor" for when people write their 
> messages into the forum,
> > eg: make this bold and that italics and that centered and that with an 
> image
> > and so on I had actually seen a (dhtml, I think) form some time back 
> where you could
> > preview your message at the side as you made changes...somewhat like 
> what google has for
> > their ad-cents accounts where you can change the colors of your ad and 
> immediatly
> > it shows the changes at the side in a box.
> > I remember sometime back someone posting some WYSIWYG kind of editors 
> which
> > loads on the clients machine with just a textbox and the buttons to go 
> bold,
> > italics,centered etc unfortunatly looking into the archives i cant find 
> it.
> >
> > Thanks,
> > Ryan
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
M.Saleh.E.G
97150-4779817

--- End Message ---

Reply via email to