Make it this way:
Looping first. I will loop with while:
$i = 0;
$array = Array();
while (list($value) = mysql_fetch_array($result)) {
$array[$i] = $value;
$i++;
}
Arrays are easier :-) Each $i will be a key.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/to
Curl, gd, zlib, sockets, pdf... pear is fine but you don't need your isp
to install, can have on your own directory. Humm... if possible, no
safemode() enabled :-)
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.su
Is there a way to do something like this?
I wrote a wanna-be debugger. It just write to a file simple and common
used function and variables, array or objects. Then when I activate it, a
new window is opened with these information. Simple stuff.
The problem is that if I do this:
fwrite($f
$REQUEST_URI?
If it's not the full you can complement with $HTTP_HOST or similar.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Ben Edwards" <[EMAIL PROTE
Okay, just phpinfo(); and use the variables. You can see whetever you will
need there for url script construction. If you need, setup two pages with
phpinfo() and a link between them so you can check for Referers (the Last
Url you need)
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge
return; stops a function execution.
Function One()
{
If (!$var) {
return;
}
}
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Mauricio Cuenca"
Using sessions, $HTTP_HOST, form keys, $HTTP_REFERER, ip address,
Javascript.
On a session you can record the user_agent on the first page, the ip, the
host, and check on the form's action page. Form keys are some number you
come up and pass either via url or post, and check on the action pag
How about:
$site_root = '/www/user/htdocs/';
Instead of going relative, go from the root. Or you could put $site_root
as your url:
$site_root = 'http://www.your_site.com/';
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinh
Still you can use Javascript. get it and reload the page appending the
info on the url. Or write to a file and open with php.
Or you could get what country the user is and calculate the time zones.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei?
For example:
$sql = "SELECT id FROM table WHERE name = '$name'";
$res = mysql_query($sql) or exit (mysql_error());
list ($id) = mysql_fetch_array($res);
That's it, use list() to make a variable, from mysql_fetch_array(). Very
useful indeed for one line returns :-)
More than one column:
$sq
Cookies disabled? Or cache? Have you tried a 'fresh' Opera install or a
newer version?
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Steve Fitzgerald" <[EM
Referer page ($HTTP_REFERER), current page (REQUEST_URI), ip
($X_FORWARDED_FOR or $REMOTE_ADDR), host ($HTTP_HOST), time (date() or
database's NOW()), username (if you have somekind of authentication), the
operating system and browser (from $HTTP_USER_AGENT or similars).
These are the ones I lo
Checkout the substr() function. You can do something like:
if (substr($var, -9) = '_.jpg')) {
// do something
}
-9 would be the staring position. I am not sure if this is the right
number, so you will have to look at the manual :-)
--
Julio Nobrega.
Um dia eu chego lá:
http://sourc
Make an autoincrement/primary column?
Or keep a number stored and increase it one by one and using when
derirable?
I prefer the first one :-)
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/w
PhpMyadmin now have somekind of authentication method. From the docs:
What's the preferred way of making phpMyAdmin secure against evil access?
This depends on your system.
If you're running a server which cannot be accessed by other people, it's
sufficient to use the directory protection bundl
Yes, if the user you are, and are trying to access the dir/files, also
have access to them.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Andy" <[EMAIL PRO
There's Metabase, one said to be the most complete of them all, available
at http://www.phpclasses.org/ and PearDB, available at http://pear.php.net.
I am using Pear, most because it takes advantage of another shared classes
from Pear itself. For example, the Log class from Pear can use Pear'
http://www.oscommerce.com/
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Robert Collins" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL
Mysql table with a meta column and a url column:
$url = $PHP_SELF;
$sql = "SELECT meta FROM table WHERE url = '$url'";
Just select from the database a meta column depending on the url people
are.
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Qu
>Basically, I just want to know if the Key is set, and if so -- remove it...
unset();...
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Jason Caldwell" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How can I remove an Array Element fro
There are a few:
I use and I believe more in Pear. Metabase is huge. PhpLib, simple but
effective. ADODB, nicely done.
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Alberto" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Any1 knows
Well, (things are going pretty good, aren't they ;-))
Oh, old Dos memories coming
Got it, pkzip was the name:
http://www.google.com/search?sourceid=navclient&q=pkzip
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Stefan Rusterholz" <[EMAIL PROTECTED]> wrote
These lines will do what you asked, but I am unsure if they will resolve
your problem (since I don't know Fatcow and how they configured the server).
Anyway, here it is:
header ('Expires: Mon, 26 Jul 1997 05:00:00 GMT');// Date in the past
header ('Last-Modified: ' . gmdate('D, d M Y H:i:s
When they click logout, remove the marker from the database that specify
they are logged in.
Then you must on all pages see if this marker is either 'on' or 'off'. But
sessions would be better for this since it is one sql query less. Just
unregister the variable on logout and check with:
if
header(); function is fine. Another option is javascript which is
dependent on the client software.
But you get the picture about the login process. I just have to agree with
Chris, something name 'is_logged' is better than 'accessedbefore'.
--
Julio Nobrega
A hora está chegando:
http://to
Hi!
For the programming language, I would go with PHP over any other. Yes,
yes, there's no best language for every task, but with your C++ background
it should be easy to develop advanced techniques on PHP than on others on
short time.
Depending from what you meant with 'background apps to
trim(); it before?
--
Julio Nobrega
No matter where you go, &this.
"Spunk S. Spunk III" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I need to check variables for blank values but it appears that is_null and
> =="" return true if there is a space.
>
> Any
Here are a few links that might help you:
'Zend Encoder':
http://www.zend.com/zend/products.php
'PBC':
http://pbc.sourceforge.net/
'AfterBurner Cache':
http://bwcache.bware.it/
Pear's cache classes may also protect a little bit your code... I don't
know how easy it is to break the file gener
if (ereg('special word', $string)) {
echo 'Found';
} else {
echo 'Not Found';
}
--
Julio Nobrega
No matter where you go, &this.
<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hey ..
>
> i want php to do an IF, when he founds a special word in a stri
Well, I don't really get what is your problem here. :-)
You said people must 'enable' pages to have it available. Is it not only a
matter of checking this 'enabled' flag? For example a database table with a
column named 'enabled', and others 'link' and 'text':
(example for mysql)
Make it global or pass it as an argument:
function CurrentLang(){
global $HTTP_SESSION_VARS;
$language = $HTTP_SESSION_VARS["LangID"];
echo($language);
}
Or:
function CurrentLang($HTTP_SESSION_VARS){
$language = $HTTP_SESSION_VARS["LangID"];
echo($language);
}
--
Check it out www.hotscripts.com/PHP, under the section 'Scripts and
Programs'. You will find a lot of ready to run php scripts that will do
exactly what you want...
And not what you said you want ;-)
--
Julio Nobrega
No matter where you go, &this.
"Yura" <[EMAIL PROTECTED]> wrote in messa
I had this problem with the CGI installation version. Modify your
httpd.conf and adapt it to run PHP as an Apache module and all should work
fine.
--
Julio Nobrega
No matter where you go, &this.
"Jason Reid" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I
Register the submited vars values on a session and echo them inside the
value="" part (or similar behavior, selected, checked, etc...) of your form
fields.
--
Julio Nobrega
No matter where you go, &this.
"Zavier Sheran" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROT
Save the queries on different files, one for each query. Then make a
script that will read all these files and execute the queries, maybe run it
as a cron job, and delete the succesful ones . With several files will be
easier to spot an error if occur, just open it and see the query.
Okay, it
Mind if I ask why? I do have a few ideas, but I feel I am terribly wrong
about them :-)
--
Julio Nobrega
No matter where you go, &this.
"Zeev Suraski" <[EMAIL PROTECTED]> wrote in message
5.1.0.14.2.20011128204245.01e71090@localhost">news:5.1.0.14.2.20011128204245.01e71090@localhost...
> And
Used to happen the same here when I was using PhpMyAdmin. On large
consults, it would lock.
Passing from CGI to module solved all my problems. On the manual you can
see the necessary lines to do such.
--
Julio Nobrega
No matter where you go, &this.
"Lallous" <[EMAIL PROTECTED]> wrote in m
Worry not, easier typing:
$search .= " ba = '$b'";
If above doesn't satify the needs, maybe you are mysql_escape_string();
it?
--
Julio Nobrega
No matter where you go, &this.
"De Necker Henri" <[EMAIL PROTECTED]> wrote in message
3A8ED7A62794D311AA7700508B6164EC08DCA3E5@SCPTS01">news:3A8
Function number_format(); should do the trick for you, maybe with the help
from str_replace('commas' for 'dots');
--
Julio Nobrega
No matter where you go, &this.
"Sascha Ragtschaa" <[EMAIL PROTECTED]> wrote in message
7208FD73D511B7040050BF68EF1E027A09@MUCMAIL">news:7208FD73D511B7040
$word = 'bingo';
$sql = "SELECT a_column FROM table WHERE text_column LIKE '%$word%';
$res = mysql_query($sql);
// etc... for displaying results
Resuming:
% on the beggining - doesn't matter what comes before
% on the end - doesn't matter what comes after
--
Julio Nobrega
No matter where
http://info.astrian.net/jargon/terms/f/foo.html
Btw, it was just a matter of googleing for 'foo bar origins'.
--
Julio Nobrega
No matter where you go, &this.
"Christoph Starkmann" <[EMAIL PROTECTED]> wrote in message
B120D7EC8868D411A63D0050040EDA77111904@XCHANGE">news:B120D7EC8868D411A63D0
Dirty trick:
http://www.php.net');
while (list ($line_num, $line) = each ($fcontents)) {
// echo "Line $line_num: " . htmlspecialchars ($line) . "\n";
if ($line_I_want == $line_num) {
$dirty_trick = htmlspecialchars($line);
}
}
echo $dirty_trick;
?>
No knowledge of what
> But that could be due to server capabilities of my ISP (if he has for
> example a high tech mysql-server and a relativly slow machine for apache).
Probaly :-)
From this page:
http://www.mysql.com/information/presentations/presentation-oscon2000-27
19/
You can read on section 'Gener
Well, you could go to www.hotscripts.com/PHP article and tutorials
sections.
But it is easy.
Delete syntax is:
This will boom every record.
DELETE FROM table;
This will boom every Joe:
DELETE FROM table WHERE name='Joe';
This will boom an id. That's probaly the way you want. A
>(I think I need their
> assistance if I want to use PhpMyAdmin, right?
Most of the time, no. These are the lines you usually need to change on
PhpMyAdmin config file:
$cfgServers[1]['host'] = 'localhost'; // MySQL hostname
$cfgServers[1]['user'] = 'root'; // MySQL user
Hi, please be more specific. Including what error you are getting, what is
the tools being used, and their versions.
Here's a quick help for producing better questions, wich will in turn make
us answer faster and with more quality:
http://www.tuxedo.org/~esr/faqs/smart-questions.html
PS:
I don't know if it is the best but here's an idea:
INSERT INTO table SELECT ha, he, hi, ho, hu FROM table LIMIT 1;
--
Julio Nobrega
Don't eat the yellow snow.
"Jim" <[EMAIL PROTECTED]> wrote in message
news:p0510100fb8318736de56@[192.168.1.17]...
>
> What's the best way to duplicate a mysq
Well, I skiped this manual part :-)
Maybe the simple select and insert is the simplest form.
--
Julio Nobrega
Don't eat the yellow snow.
"Jim" <[EMAIL PROTECTED]> wrote in message
news:p05101010b8318afec141@[192.168.1.17]...
>
> It appears that this is forbidden ...
>
> From mysql.com:
You should really try to do it and see if it's possible, before asking on
the mailing list... mainly because you will be satisfied with the results...
--
Julio Nobrega
Don't eat the yellow snow.
"Lee Philip Reilly" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTE
$HTTP_SESSION_VARS shows you this. I don't remember precisely if or where it
appears on phpinfo();, but you can try this to see all registered session
variables:
That's a nice way to see any array, BTW. Including $HTTP_SERVER_VARS,
$HTTP_POST_VARS, GET, etc... nice one.
--
Julio Nobrega
header("Location: example.php?var=$value"); etc...
Or sessions...
--
Julio Nobrega
Don't eat the yellow snow.
"Wilbert Enserink" <[EMAIL PROTECTED]> wrote in message
00e101c17d86$a2c391a0$[EMAIL PROTECTED]">news:00e101c17d86$a2c391a0$[EMAIL PROTECTED]...
> Hi all,
>
>
> my q: The results o
I am using an approach similar to this:
$language_file = 'english';
include 'dir/to/languages/'.$language_file.'.inc.php';
on english.inc.php
Than you just go echoing the array elements where you want the text to
appear. It does require a little bit more of typing but the languages files
Session would be the easiest thing to use. You could also 'pre-store' the
info on a database and retrive it depending at what page users are visiting.
--
Julio Nobrega
Don't eat the yellow snow.
<[EMAIL PROTECTED]> wrote in message
BB6D932A42D6D211B4AC0090274EBB1DA0F14F@GLOBAL1">news:BB6D93
Yes! But since one must learn by trying, I will give you some general
rules.
Okay, make it work as a function. You need the page url to grab and the
word to search. So it's a function with two arguments:
function do_it ($page_url , $word) {
Then inside the function you fopen() the $page,
Hi all,
I was sure I saw something like this on this list one month ago. But I
search for like dozens of word combination to find this post (or anything
related to), and was unsuccesful.
Anyone has a quick snippet that will scan a bunch of text characters and
return the links as an array e
> THE INSIDE EDITION
I thought it was out there?
--
Julio Nobrega
Don't eat the yellow snow.
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]...
> EDWARD LAWRENCE STRONG PRESENTS
>
> THE INSIDE EDITION
>
>
Hey, love the colors! But that's a regular ant. Where's the catch twist
exclusive hidden feature? It's an ant, but ain't no ant like other ant :-)
I don't know, usually when something common can be found on a design
there's a little mod added.
Did you draw it? On 1024 video resolution look
Hi All,
I have a few scripts using $PHPSESSID to softly disable cookies
requirement on some pages. I just installed PHP 4.1.0 and I am porting some
lines to adapt to the new version.
If I do this:
It doesn't show nothing at all. Did something changed, does this var now
have a new nam
Hi again,
Here are a few updates (error_reporting(E_ALL)):
$_SESSION['PHPSESSID'];
// Undefined index PHPSESSID error
// Doesn't work. Not even a undefined variable.
// echo $SID doesn't either
But:
echo session_id();
// works!
Thanks Andrey for the remainder, but session were already
Well, there's a small difference between form's GET/POST and passing
variables using the ? on urls. I don't know the techinal details of it, but
it's possible. I guess, on this particular case, the form method is POST.
When the next page is loaded (the action target), you put some GET
parameters
> However, you can't do this:
>
>
>
> Because a & b won't get submitted.
Well, like I said, I don't understand very well, but things after the ?
are available on the action page, even if the method is POST. Here's a
tested example (PHP 4.1.0, Win2k AS, Apache 1.13.20)
aaa.php:
bbb.php
Yes, I know. But the problem is PHP 4.1.0, or maybe something on the new
php.ini that comes with. My scripts were echo'ing $PHPSESSID fine before it.
--
Julio Nobrega.
Um dia eu chego la:
http://sourceforge.net/projects/toca
"Andrey Hristov" <[EMAIL PROTECTED]> wrote in message
032e01c187db$
Yes! That's it. I was accessing vars using new methods, but I forgot
$PHPSESSID was supposed to have globals on. So simple, yet I have flooded
the list with messages.
Thanks Andrey, I think it's better next time look at all possible options
;-)
--
Julio Nobrega.
Um dia eu chego la:
http://
Is that while porting a script to PHP 4.1.0, where I used to check:
if (session_is_registered('del_power') && $del_power == 1) {
// del stuff
}
Because $del_power could be registered as 1 or 0, now I can do:
if ($_SESSION['del_power'] == 1) {
// del stuff
}
Nice. Less typing and
Yes, but I just thought of doing this way when porting :-))
PS: (Not 100% true, there's the question of $_SESSION being global now.
Makes life easier too :-))
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
--
PHP General Mailing List (http://www.php.net/)
To
Append the session id on the url.
There are several ways to do this. Change all urls to put it at the end,
add a javascript that will do it for you (saw at php.net's page). Or change
an option at php.ini to this also automatically for you, or use ini_set();
if you can't change the .ini.
--
Encode (or compile) the source.
Zend's compiler costs 2400 dollars. At this cost is better to release your
code on an open source license ;-)
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Peter Allum" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL
Hi Manuel,
Great post. I enjoyed the part where you said it would be a good idea to
do some 'competition' with php programmers, sponsored by some company.
For example, most times when I want a php script, either I go to
Hotscripts.com or Sourceforge.net.
Sf.net, by rebound, makes me rem
How about Mono from Ximian?
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Reductor" <[EMAIL PROTECTED]> wrote in message
008001c12df9$e96806e0$eb00a8c0@mum">news:008001c12df9$e96806e0$eb00a8c0@mum...
> Just looking over the achives of the .net show(was msdn show), and wi
ws:003901c12ef8$fd9a4ec0$eb00a8c0@mum...
Mind giving some more infro on this :D ?!?
- Original Message -----
From: "Julio Nobrega Trabalhando" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 10:36 PM
Subject: [PHP] Re: Thinking about going to ASP
&g
Well, you could change just to look at this.
Use php's functions to change, check the last modified, and change it
back. Should take a few micro-seconds ;-) and it only uses php.
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Jay Paulson" <[EMAIL PROTECTED]> wrote in
Hi All,
I already spent too much time trying to solve this one by myself, so I am
in need of a little bit of help.
I have a form with checkboxes, all with the same name (name="noticias[]").
When it is submited, only the selected checkboxes become a value on the
array $noticias on the next
Hi All,
Another doubt. How can I delete files older than X seconds from a given
folder?
At the on-line manual I could only find a contributed note about 'discover
time of last modification' from a file under a folder.
Any help is appreciated.
--
Julio Nobrega
A hora está chegando:
ht
I am the type of guy that sits and code. But now I am working on a company
where we sell systems to large financial entities. So, I have now to make
'prettier' stuff for high executives understand.
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Ninety-Nine Ways To Die" <[
echo '
xml version="1.0" encoding="iso-8859-1"?>
That's how I am putting my XHTML on SF.
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Cweiske" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi
>
> I wrote my new page in XHTML 1.0, s
Sometimes I have to add the 'extensions' word:
extension=extensions/php_mssql.dll
--
Julio Nobrega
A hora está chegando:
http://toca.sourceforge.net
"Mark Roedel" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> -Original Message-
> From: Brandon Or
101 - 176 of 176 matches
Mail list logo