I'm trying to make a small script that I can use for randomizing teams and
stuff, I have one field where I enter how many teams, one for how many in
each team, and a to write down all the players in. This is where
my brain stopped working, first I was thinking about using split, but I
don't know
Is there some easy way to make rand() only use each number once in a loop,
to avoid getting the same values more than once?
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a for loop, and an if that checks something, and if true, it's
supposed to add info to an array called $ra, but instead of adding it to the
array it seems like it's overwriting it, currently I'm using $ra[$r] =
"$r"; where $r is a number..
after the for } I put a print_r($ra); and it only
Tried that now, and with the same results
print_r($ra); still only shows the last info inserted in the array :/
"Aaron" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> just assign the value to $ra[]
>
>
> "Hawk"
this is the way I was trying to solve
it, just can't get it to work, even if I think it should :P
"Aaron" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> can we see the code?
>
> -aaron
>
> "Hawk" <[E
hahahaha, that was so stupid of me... should have put if (! $ra) { $ra =
array(); } but I seemed to have missed this.. lol :P
thanks for your help and sorry for being an idiot ;D
"Hawk" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED].
is there some way to save all the info that is after the .php? in a var?
need that for a function on my page, but I have no idea what to look for
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
is there some way to "disable html".. if someone posts a msg with
my entire layout messes up :)
I have no idea how to solve this, but it's messing with my brain, I tried
the htmlspecialchars, but that didn't help :/
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visi
I've never really payed attention to this before, but now I noticed that ==
is case-sensitive, how do I make it == with different "cases" ?
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Just for fun I, and a few friends were going to make a community, started
about an hour ago :)
Haven't started with the design or anything yet, but I was thinking how the
best way to handle users would be, or atleast what you can recommend, first
I thought about having a database with users, and o
Sorry, my bad, meant a table for each user, not a database :)
But I'll go with the shared tables then :P
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Just came to think of it now, is it possible to link to php scripts, on..
lets say my server, from an online account I have, that does not support
php.
I was mostly thinking of counters included on pages now, but other things
to, like $date() and similiar.
wxw.hostedscripts.com uses cgi for the l
I'm filling a database with info, and I'm using id as identifiers in the
list, the id is auto increment, and I deleted one entry, now I have a hole
in the database, is there any way to fix this?
lets say I have
1
2
3
4
5
6
And I deleted 6
Now it looks like
1
2
3
4
5
7
8
9 and so on
is there somew
I've been looking on the php.net page, but I don't know what to look for..
I found string mb_strcut ( string str, int start [, int length [, string
encoding]])
and it looks like the thing I'm looking for, but I don't know how to use it
:)
can anyone tell me? :P
Håkan
--
PHP General Mailing
Lets say I have a news text, and in a menu, I just want to print the first..
lets say 30 letters, and maybe add a "..." after, and link it to the full
text.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a login, and when users are logged on, it should show in some way on
the page, that's not the problem, it is to show that they are logged off
when they are, often people forget to press the logout button, and the mysql
database is unchanged, saying they are still logged on, how can I do so
Lets say I have a guestbook, and I want the text the visitors write in it be
saved in a database(mysql) and when retrieved, if should have the same
textformating, I guess this is a really basic thing, but I don't know what
to look for :)
I've caught \n and ereg*, but I'm not sure that's the thing,
so I might have missed something, but i think it's wierd anyway... :p
please reply as soon as possible. :)
Hawk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators,
ou set up your sessions would also be helpful...
>
> /dkm
>
> - Original Message -
> From: "Hawk" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 15, 2002 11:19 AM
> Subject: [PHP] Login script, session problem (I think)
>
&
O in the query but that didn't make any difference :p
if anyone could tell me what I'm doing wrong I would be happy.. :p
"the best way to learn is to ask people that know" :p
Hawk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED
.. worked with the user info
update and so on.. but I seem to do something wrong and can't log back on
since I encrypted the password... :p
I used UPDATE users SET password=password('$password') but by some reason I
can't seem to decrypt it on the login page.. any help would again be
ap
)
I tried with
$query = "SELECT * FROM users WHERE username='$username' and
password=password('$password')";
but that made $num = 0, and the login fail
I'm getting really tired (from sleeping to little..) and that might have
reduced my thinking even more tha
I have encrypted the passwords for my login script with the mysql command
password('$password') ... is there any way to encrypt to the same format in
php? Seems like the above isn't working atleast..
Hawk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe,
atleast it shows I have
an encrypted password, but the problem is that the line everyone uses
doesn't work.. maybe I need to change some setting in mysql och php.ini or
something? anyone have any idea?
I know I've asked this several times but it doesn't seem like I'm understood
I've asked this several times but it doesn't seem like anyone understands my
problem, the passwords are encrypted in the database, but I don't know how
to match an unencrypted password from the login form with the database?
is it possible to encrypt the password I sent from the form in php or does
what do I type to redirect or refresh a page after a sertain time? :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
Let's say I have a database that recieves new information about 6
times/minute and I want the database to be checked to frequently to limit
the maximum entrys to the database to.. let's say 100.
And also timeout users if their session has been inactive for, let's say 20
minutes.
--
PHP General
is there any way to destroy a session automaticly when a user closes down
you page?
And preferably perform an action like a database removal at the same time.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PRO
can anone show me a good example how to use this function?
I'm not really sure how it works
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTE
I have a newssystem on my homepage but you have to scroll rather long to get
to the last post now, how do I limit it to show like 10 posts per page or
something like that? With one document that is, I don't want to have a bunch
of files with 10 posts in each .. :)
--
PHP General Mailing List (
ow if this sounded completly wierd, but I'm bad at explaining :)
Hawk
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lets say I have 30 lines of text and I want to store it in a folder called
"txt" with the filename $name.txt and, if $name.txt exists, create a
$name1.txt or similiar?
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a group table with 16 items, and I want them to be randomly put in 4
different groups, with 4 in each group, I've seen the $rand(x,x) thing, but
is there any way to limit to 4 in each group without 47839 rows of code? :P
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubs
Web.com - Professional Web Design
> www.PaginiWeb.com
>
>
> "Hawk" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I have a group table with 16 items, and I want them to be randomly put
in
> 4
> > different gr
Is there some var that does this automaticly? I don't really know what to
search for on php.net.. :P
If there isn't, is there any other way to do this? I know it's possible with
asp but I have no plans on using asp :P
Håkan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vis
I was checking around on a page I made, and I just noticed the lack of
security, it is rather easy to gain admin status if you enter the right
?blabal=blablabla after the url, I need some help to make this secure, I
tried with adding a name check to, but that didnt work since the
?user=blabla can
Lets say I have a guestbook, and that I only want to show the last entry on
my first page
I cant figure out a good way to do it..
haven't managed to find a mysql command that can do it either, but maybe
there are? :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http
This is just speculations, but I thought I'd as well ask now before I get to
work
Lets say I have a news page, and I only want the last ten posts to show on
it, then I ORDER BY id ASC LIMIT 10 right?
but how do I add the next page?
count rows from the database and see if its more than 10 lines, an
I have a clan database, and some clans use <> in their tags, my problem
right now it how the best way to print these as characters, and not code..
any easy suggestions?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a function that should count the amount of times a file is being
downloaded
first I want to have a redirect to the file in some way, and then for the
browser to go back to the local files page, it goes back to the files page,
but the file doesn't download...
Håkan
--
PHP General Mailin
maybe this is not a php question but I thought I might ask here to, since
someone might know..´
is it possible to make a avi movie play inside an explorer window?
I just get it to open up in windows media player..
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http:/
Please note >>> if you dont need it now you may will need it later so
please save it for the future :) :)
Message: Destination: Amman
Season: January - December
Languages: English, Arabic
Minimum Cost: 50 US Dollar (USD) Per day
Maximum Cost: 100 US Dollar (USD) Per day
I have a 6 years exper
On a few sites we have used a master include or function file containing all the
unctions required for the site... Some of these function files may contain
30-40 functions and some pages use only 1 function from the file.
Would like to be a little more dynamic in our approach of this, and have st
he function was already called and included, and if
not, include, then run and return the result. this would avoid having to
include explicitly any files containing functions on any page as they would all
be loaded dynamically.
Am I groking this correctly?
Original questions/requirements inclu
>John, PHP-general,
>
>OK. I think I understand this, but let me ask just to be sure.
>
>So if I setup in my page something to this effect:
>if ($_SERVER['!HTTPS']) {
> echo "Switching over to SSL...";
> echo "";
yuck
recommend insuring this is at the top of your page and using header
Here is what I am looking at for a partial solutions (see "redirect missing
function error" for my next hurdle)...
All functions are contained within individual files in a "functions" directory,
none of which are hard included into the PHP pages;
eg//
./functions/ShowThis.php
./fun
related to "Automatic include of files containing functions"
Can we capture errors for missing functions and have the script correct the
problem and attempt again?
For example//
$result=MyFunction($someVariable);
if this function doesn't exist, PHP generates an error. Capture the error
Recently reconfigured php to add in support for some extensions we were
previously not using (Pear among others).
switched to src directory, backed up config.nice
edited config.nice to remove/alter the appropriate "--without" lines
rm config.cache
./config.nice
make (no errors)
make install (no er
>Guys? The support guy says that my php-script brings his php interpreter to
>crash. I am astonished (wow-what a powerful man I am :) ) - no, but really,
>it doesn't crash MY server? He also said, it happens just right after the
>file is being asked for, that is, as I suspect, somewhere in the firs
Creating a quick script where we can poll the services on a particular server to
verify if they are running or not. this will be included in a larger scope
application once the details are worked out.
Am having a problem getting results from queries to web server ports though.
Port 80(std), 8080(
>Hi all,
>I am getting crazy, can't understand what i missed!
>Does anybody know?
>
>$champs = array ("titre_art" => "h3" ,"nom" => "bleu", "prenom" => "green",
>"resume" => "bold");
>
>foreach($champs as $key => $value) {
>
>
>echo "$row($key))";
> }
never used foreach()... but I
any takers on this, before I give up and drop to curl for those types of
requests?
Dave
>Creating a quick script where we can poll the services on a particular
>server to
>verify if they are running or not. this will be included in a larger scope
>application once the details are worked out.
>
>
Live server was previously a 4.0.4 install that we upgraded to 4.2.2
Am getting ready to upgrade it again to 4.3.2 and wish to verify some things.
1) any caveats to be aware of?
2) it appears from reading INSTALL that a seperate build isn't required if we
want to run both dynamic and static, just
any takers on this?
>-Original Message-
>From: Dave [Hawk-Systems] [mailto:[EMAIL PROTECTED]
>Sent: Thursday, July 10, 2003 11:09 AM
>To: [EMAIL PROTECTED]
>Subject: [PHP] Upgrading 4.2.2 to 4.3.2
>
>
>Live server was previously a 4.0.4 install that we upgraded to
looking for code snippets or links to examples of the following;
- Have a database with multiple fields that will be searched against (happens to
be PostgreSQL in this instance, but we can migrate any MySQL based
examples/code)
- We wish to score search results - ie: a match in "keywords" is worth
Appreciate the responses...
>> Try
>> SELECT , (((keywords LIKE '%$search%') * 5) + ((title LIKE
>> '%$search%') * 3) + (description LIKE '%$search%')) score FROM .
>> ORDER BY score DESC
>
>PostgreSQL cannot type cast the Boolean type so you have to use a case
>statement, also changing li
>> Is it possible to have a function which echoes the values as they are
>> read from the database?
>
>something like
>
>function init_auth_list()
> {
> print " select the name of
>the author";
> $query="select name from author order by name";
> $result=pg_exec($GLOBALS[
a while ago we upgraded the php installations on our servers. for a quick fix
we set register_globals to on for code compatibility. Since then we have been
cleaning up code to eliminate this. We likely still have some virtual hosts who
are using these globals though, so while we are wanting them
we are dropping to a perl script to process transactions, occasionally the
remote server the perl script interacts with becomes bogged, the transaction
goes into limbo, or for whatever reason the processing of that transaction hangs
(happening about 0.2% of the time).
Is there a way to time and ti
>>I want to be able to view a single log that contains the following:
>
>http://php.net/error_log
>
how about this curve... getting PHP to append a line to the apache log.
Currently we are exporting via fopen clf formatted logs for file uploads (whose
file sizes are not recorded by Apache's l
>>how about this curve... getting PHP to append a line to the apache log.
>
>How about reading the documentation?
Deserved that for not being clear enough... see below.
>http://php.net/error_log
>
>>would much rather pump the clf formatted log sting directly into the
>appropriate
>>apache log,
>Thought I turned on register_globals on in the php.ini, my server
>didn't know the HTTP_POST_FILES.
>
>echo $HTTP_POST_FILES[$file]['type'] ;
>
>echo $HTTP_POST_FILES[$file]['name'] ;
>
>echo $HTTP_POST_FILES[$file]['size'] ;
>
>I've always get these messages:
>
>PHP Warning: Undefined variable:
>I have never charge by the page simply because I don't want to be
>limited in my design. Also, I don't want them saying I've added unneeded
>pages to up the price.
or have customers nitpicking about removing pages to cut costs...
>I don't know how you would charge by the script since you should
>Wow, Thank you for the explanation, it helped out a lot ;)
>I don't know regex very well, but I hope that this will give me a better
>understanding of it.
>Thank you Yet again,
>Mike
>
good luck understanding. personally it is one of those things that I dust
off and pull out the help docs e
>> $dataFile =
>> @fopen("/home/blurredv/data/".$username."Contact.txt","w");
>> fputs($dataFile, $line);
>> fclose ($dataFile);
>>
>> These are the errors:
>>
>> Warning: Supplied argument is not a valid File-Handle resource in
>> /home/blurredv/public_html/redcarbon/update.php on line 34
>
as part of a larger application we have a bit of code that processes whois to
determine domain name expiry dates. Most formats are easily parsed, but
Register.Com has thrown the little regex for a loop and I am unsure as to a
clean workaround.
Here is what we have;
...
$pregmatchstrin
>Here's what I wanna do:
>On the first page I collect a lot of formfield values into a cookie. On the
>next page I display the content of this cookie. This works.
>What I even want to do is mailing the cookie content in the same time I
>submit the forms in the first page (or, when the new page loa
$users=file('.users');
# puts users in the file into an array so we can
# check for valid or priv users with
if(in_array($HTTP_SERVER_VARS["REMOTE_USER"], $users)){}
# we add additional users to the .users file with the following
$users[]=$newuser;
# adds the new user to the end of the above cre
variable variable... right up there with array array
basically what you are saying is resolve $var, then find out what that variable
holds
example;
assume your $counter is currently at 5
$var = "v".$counter."_high_indiv";
would mean that $var= "v5_high_indiv"
assuming that v5_high_ind
>On Tuesday 16 July 2002 21:53, Dave [Hawk-Systems] wrote:
>> $users=file('.users');
>> # puts users in the file into an array so we can
>> # check for valid or priv users with
>> if(in_array($HTTP_SERVER_VARS["REMOTE_USER"], $users)){}
>>
>
>> >> $users[]=$newuser;
>> >> # adds the new user to the end of the above created users array
>> >> # then write the array to the file
>> >> $fd = fopen (".users", "w+");
>> >> fwrite ($fd, join("\n",$users));
>> >> fclose ($fd);
>> >>
>> >> the problem is after adding users, only the last user r
>Start from scratch. You have a file with a single user on each line:
>
>tom\n
>dick\n
>harry\n
>
>You use file() to read into array $users.
>
>You compare as in above.
>
>You add a user by:
>
> $users[] = "NEW_USER\n";
>
>You write out the file as above.
curious... when I ran through that (bef
other than each'ing an array and performing a regex match, is there an easier
way to parse through the values in an array for a value matching
*something*somethingelse*
thanks
Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
we have a number of csv dumps that occasionally have to be used to update tables
in a postgres database...
normally this is done by uploading the file and whomever running a php based
parser which opens the file into an array via file(), does a split() on the
comma, then executes an insert or upda
have a situation where clients will be uploading images via a web interface.
We need to process these images to create thumbnails. In the past we have used
image but have found that the output is somewhat less than desireable and
limited to jpg.
We would like to be able to soften the image p
a production box running 4.2.2 recently had a script added to it requiring use
of xml functionality. The box was already compiled (a few versions earlier)
with the --with-xml option. Since then, have upgraded this box twice (though it
is due for another) using config.nice to ensure the same optio
>a production box running 4.2.2 recently had a script added to it requiring use
>of xml functionality. The box was already compiled (a few versions earlier)
>with the --with-xml option. Since then, have upgraded this box twice
>(though it
>is due for another) using config.nice to ensure the same
any warnings, problems, or other issues we should be aware of... production
server, already addressed the register_globals issue
Dave
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
78 matches
Mail list logo