Hello
Is it possible to send all incoming requests to the same script within
PHP?
In other words: How can I get http://mysite/script.php to point to the
same script as http://mysite/anotherscript.php ? And is it possible to do
send a request like
http://mysite/someextrapathinfo to the same php
Hello
First of all thanks for the suggestion. I thought something along these
lines. The disadvantage to this approach in my opinion is that I have to
include the controller in all pages and it is therefor not possible to
integrate pages which I do not control without breaking the concept of
r
Hello
I checked the PHP manual and couldn't find anything on this...
When I call session_register() an implicit call to session_start() is
executed. So if the session handling uses cookies to track the session and
the call to session_register() is not before any output this will cause a
header
Hello
As far as I rememeber according to DOM Level 2 Elementnodes contain
Attributenodes but the Attributenode has no association with its
Elementnode meaning you can't tell from an Attributenode which Elementnode
it belongs to unless you remember it in your code. Thus an Attributenode
is not p
Hello Everyone
This might be slightly offtopic since I'm not sure its php related but
I'm working on a script where some inputdata is taken for further
processing. For validation purposes I want to make sure certain chars are
not part of the input. Basically stuff like $ * :; etc...
So I'm
Hello Julie
Have you checked what is passed in your post / get request???
A Simple way of doing this is using a script similar to this one
'.$key.'='.$value; // this prints to the
browser
}
?>
This will show you a simple list of all variables being passed to your
script. I had a pro
Hello
There isn't an easy answer to this but I guess the most important thing
being that it is easier to maintain in big projects and this makes it more
robust since you can test in a more modular way. Also it makes it easier
to reuse code also this seems to be one of those urban legends. At le
Hello
'salt' basically is the initialization sequence for the encryption. This
makes the function use more random numbers since the salt will be
different on different calls. At least it should be
So in order for your crypt() to work you have to pass the same salt to
both functions.
To de
Hello everyone
I reread the manual again on the topic of backticks and from that I have
security / usabilitiy issue.
Here is the issue:
When I check formdata from a simple form I use regular expression to make
sure the input confirms to certain guidlines before including them into my
scripts.
> if(ereg("^[0-9]{7,9}$", $_REQUEST["icqnumber"])) {
> >> print("a-okay!");
> >> } else {
> >> print("error msg");
> >> }
Although I'm not too familiar with regexp I'd say the code validates
because the icq number you are providing actually confimrs to the pattern.
The first seven to nine digits
Hello Everyone
I'm running PHP 4.1.2 (no I can't upgrade at the moment) and I'm running
into a problem with open_basedir.
The way I understand the open_basedir directive it allows only file access
to the directory mentioned and its subdirectories.
In my setting I have a directory setting in th
Hello
If you simply want to check if the fields contains Po BOX simply use the
stripos function or one of the other string functions. They should be
faster than reg ex.
If you still want to use reg ex I suggest using preg_match since it is
faster than ereg.
About your regex:
It will not find o
Hello
The only way I can imageine is using curl and doing standard post get
requests. But this will put you at the mercy of the other dep. since a
change in design may force a change in your logic.
If you can, try to build a separate interface for your app which you can
use to interface the bac
Hello
Webservices is the use of SOAP over HTTP to bring a Service to the web.
There are a lot more technologies involved like WSDL and UDDI but
basically it is a way of providing the functionality of a
programm/application to the web over a well defined interface. Since it is
an additional lay
Go with the costs. If you have a running system on apache + php + mysql
see how much it costs to support that platform. Meaning how high are the
costs to maintain it. Inclusive administration and deployment of apps.
Then compare the costs of maintaining a IIS Windows PHP Mysql setup under
the s
> preg_replace("|.*?$file.*?|si","",$contents)
>
>
> fhh
> 1060205191
> hhh
> xml/news/1060205191.xml
>
>
> fgjghjh
> 1060205186
> fgjh
> xml/news/1060205186.xml
>
>
> fgjhh
> 1060205182
> fghh
> xml/news/1060205182.xml
>
>
Not sure if I understand you correct
Just a remark but isn't it pointless to use Hungariannotation in a
language that is by default typeless???
Regards
Stefan Langer
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hello
>From a usability standpoint showing a checkbox that cannot be unchecked
renders the checkbox obsolete. The consquence is not to show a checkbox at
all. If you need an uncheckable checkbox because of licence aggreements or
something like that. Or privacydeclaration type checkbox. Make it
Hello
First of all NO there is no way of reversing the MySQL password function
since it is a hash not an encryption.
I think the real problem lies in your concern for security. Why hash the
password or encrypt it in a database when you are sending it over the
internet per email?
A better way
Hello
Ok can't refrain from giving my opinion to this one.
First of all I think separating presentation from business logic can be
achived fairly simple with SMARTY and if your template code acutally
contains business logic than you have not understood the concept of the
template engine. The
I might be mistaken but what you are getting is the normalized whitespaces
inbetween your nodes, which is considered to be their content.
Example:
...
Will return the following dom:
test
|
---
/ | \
#text
First of all I comply with all my previouse poster.
For all the readers of this list I'd suggest to read the following
article:
"How to ask questions the smart way" at
http://www.catb.org/%7Eesr/faqs/smart-questions.html
It's an instruction booklet on how to ask questions on lists like this.
One thing that hasn't been mentioned explicitly about register_globals
turned to off is the readablity of the code and thus the reuse of code.
When you use GET, POST, etc... everybody reading your script knows exactly
where the data is coming from and can make a fairly good assumption to its
us
[snip]
Can I trust every
browser to check for old cookies on startup and eliminate them? And still,
even if I can, wouldn't the cookie be intact to read on the harddrive
until
the browser is started again? I was thinking about slicing the username
and
password strings in two, and storing the halv
Hello
Well here is my opinion on the two.
I think it is a lot easier to get an app ready and running with PHP
(especially database driven) than it is with JSP. The memory footprint of
PHP is a lot lower than with JSP. Alone the JVM that needs to be loaded
requires lots of resources. Also inst
Depends on the use of the function. (Output functions should produce
output shouldn't they?!) Best option probably is to specifiy an argument
that allows to choose wether to output or to return.
If you return text you should return by reference to prevent unnecessary
memory consumption.
Regar
Hello
Two things:
First wouldn't it be faster to use strpos and substr if you simply have to
find the literate and .
Second: If you use your regex and you have something like
" This is some text to grasp this is
text I don't want This is some other text I want"
The result would be " This is so
Hello Everyone
This is slightly off topic... so ignore or comment.
Just wondering where does the term RTFM actually originate. And wouldn't
it be better to say RTM or RTAM (thats Read the amazing Manual) since as a
foreigner, that means non english native speaker, I can't see whats so
f...ing a
> I believe that there is a pure PHP
> class (does not rely on external programs) which allows you to work with
zip
> archives.
You can find it in the sources of phpMyAdmin its called zip.lib.php. It
should be located in the libraries folder.
Regards
Stefan
--
PHP General Mailing List (ht
Hello
What you are asking isn't possible that way.
You have to write a controller script that calls the appropriate functions
on your object.
Example:
controller.php is the controller script
A link on your page:
Some Action
In controller.php you do something like:
You might also want to loo
One more thing, make sure the application is running on its own server
meaning don't use a shared hosting enviroment that allows others to gain
access to your directories. In this case even placing the file outside of
docroot doesnot secure it in anyway since any other user can access it
with t
Hello Justin or Anybody else
> Store an MD5 of the password, that way you're comparing the two hashes,
not
> two passwords... even if someone stumbles into your database, they'll
only
> see the MD5'd password. A further step would be encryption, on which
you
> will have to do a LOT of reading.
As a suggestion can you simply redisplay your form on the error page and
such avoid having to use the back button? This would also allow you to
actually display the error at the place the error occurs.
Another thing you might want to try is using a cache header that allows
the browser to cache t
> Set the column type of password to be a char(32). Then, pass the
password
> through md5 to mysql to store it. To verify it, pass the password
through
> md5 then compare it to what's in the database.
This is true for your own authentication but I mean how to connect to the
database using md5.
Hello
Just asking why do you want to split at paragraphs? Couldn't you just
simply look for a word boundary and then split the columns? You could
exclude tags from the split meaning wordboundaries cannot be inside <>
that way no breaking of tags.
Since the result is checked by a human they can
Hello Niels
Use preg_replace_callback
http://de.php.net/preg_replace_callback
since it is faster than using the /e switch.
Regards
Stefan Langer
Hello
Did you compile mysql or any of the other databases into php5? As far as I
know php5 does not come with mysql anymore because of some licence issues.
So if you haven't compiled it yourself it shouldn't be available and hence
not supported by adodb.
Just a guess
Regards
Stefan Langer
> preg_replace('/*\<[a-z]+)[0-9]+(\>)/', '$1$2', $String);
Ok why not simply use reg_replace('//', '//', $String);
BTW preg regex are more powerfull since they support some stuff that the
posix standard does not support. As far as I know lookbehinds and
lookbacks and stuff like that. Also the PO
hello
just a side note
instead of
> ereg( '^<$var>(.*)$', $line, $matches )
use
preg_match('/^<'.$var.'>(.*)$/', $line, $matches)
since it is faster than ereg.
Regards
Stefan Langer
Hello
Use a mail class to send your mail instead of mail. These classes have a
lot of workarounds for mail() problems and are fairly easy to manage.
I personally prefer phpmailer (http://phpmailer.sourceforge.net) but there
are others. Just do a search through the archive for mail or mime classe
A different approache for the captcha.. instead of using a blurred image
use some text and than ask a question about the text like
What does the 2nd word in the first line of the 4thparagraph say?
Things to make sure:
- Use enough texts so that guessing the correct word is not possible.
- Use r
I agree that an image captcha can not be cracked by a lot of people,
allthough it has been done. (and it takes only one program being released
to do the job : ) ) Somethings to keep in mind is that you should use
passphrases made up of random letters and numbers preventing the automated
system
Hello
If you are using PHP as an Apachemodule you also have the option of using
a url like
http://example.com/index.php/test/test.html
Apache will see that test.html is not available and will travel down the
directory path til it gets to the index.php (which should exist BTW) and
call that scr
Hello
Now that the discussion is coming around to be more on topic I have some
stuff to add.
First and most important: There is no such thing as INTUITIVE when it
comes to interfaces.
Every interface built for human machine interaction has to be learned by
the human using it. So what we consi
Hello
Just out of curiosity why do you need such a function? I'm no perl
programmer and have very little knowledge of the language ... yet ; )
but the way you describe it it seems to me that you have a fundamentle
design flaw in your script if you need to change types on the fly that are
in no
>$city = "Ipswitch";
>$city_found = 0;
>$contentfile = fopen("content.txt", "r");
>while (!feof($contentfile) && $city_found == 0);
> {
>$my_line = fgets($contentfile, 16384);
>$content_array = explode("\t",$my_line);
>if ($content_array[0] == $city)
> {
>$city_foun
Hello
Have you considered breaking down your form into several smaller ones on
seperate pages like a wizard? In each step you can save the entered data
preventing it from being lost. In the end show the whole form with all
data for verification by the user.
Regards
Stefan Langer
Hello
If you don't mind running a JVM you can use PHPEclipse with the Eclipse
Framework. Additionally to the php plugin there are a lot of other plugins
out there that can assist you.
http://www.phpeclipse.org
Regards
Stefan Langer
Hello
Not sure if you thought of it or if it even applies to you but when you
use
PEAR::DB::getOnce("SELECT LAST_INSERT_ID()"); to retrieve the id do
consider concurrent access to the database when using it for inserting
stuff. Been there and its a hassle to resolve this little huge bug ; )
Con
Hello
The reaseon why PCRE is faster is because the POSIX standard demands to
return the longest matching string which means POSIX checks all possible
matches while PCRE simply returns the first valid match. In cases where
there is no match both have to check all matches.
The other thing is, a
Hello
I think using UNIQUE is the way to go simply because of data integrety (<=
how do you spell this??? ; ) ) If you don't use UNIQUE and you are not
write locking your table you might accidently get duplicate Values. UNIQUE
is the only way to prevent duplicate data without a lot of hassle. T
51 matches
Mail list logo