Hello Everyone,
I want to emulate session objects (as opposed to variables). I stumbled
upon creating multi-dimensional arrays, so I can do this:
$name = 'Bob';
$year = '2003';
$HTTP_SESSION_VARS[$user][$year] = 'registered';
which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';
but I
Hello Everyone,
I want to emulate session objects (as opposed to variables). I stumbled
upon creating multi-dimensional arrays, so I can do this:
$name = 'Bob';
$year = '2003';
$HTTP_SESSION_VARS[$user][$year] = 'registered';
which gives $HTTP_SESSION_VARS['Bob']['2003'] = 'registered';
but I
Brad Pauly wrote:
$HTTP_SESSION_VARS[$user]['options'] = $options;
yes this is what I wanted.
You could then add elements to this array like this:
$HTTP_SESSION_VARS[$user]['options']['registered'] = 1;
Is that what you are trying to do?
- Brad
I will try this out and see what happens.
Thank
look into executing your php script through cron. (Cron is a Unix schedular
and nothing to do with PHP). Or you can use Tash Schedular (on windows
servers, I guess).
Also, check the archives but I think this issue was answered as above.
Nabil [EMAIL PROTECTED] wrote in message
news:[EMAIL
also look into output buffering.
so you would then do these steps
1. start buffer
2. redirect all output to varaible $output
3. echo Static HTML code (from opening to closing html tags)
4. when completly done all output, the variable $output should have all the
html code
5. then using filesystem
I haven't worked with PHP mail for a while, but since no one has responded
I'll give you something to consider:
1. Why don't you try error suppression , @ ? or you can set error_reporting
down or you can capture all output by using output buffering.
2. You can trap the invalid email, but it may
Robert Cummings [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Unfortunately I don't think some people got the joke. Next thing you
know their going to complain that PHP should have told them the
punchline ;)
I guess I got burned on that. I honselty though I could save one soul
If you want to restrict the download to once per user, the best is to use a
database (or a I guess a file) which keeps tracks of who can download it and
downloaded status, etc..
I haven't worked directly with this issue, but I would start by having a
table Permissions with columns username,
You could look at a nice GUI package that does all the database
modifications , its called phpMyAdmin (www.phpmyadmin.net).
But maybe this is too extrememe to what you want.
Matt Hedges wrote in message
news:[EMAIL PROTECTED]
Hello. I am building a webpage for a sorority-
Are you talking about editing mutiple rows at the same time?
if so there is no efficient way to check what row has been edited and which
haven't. What I would is use HTML variable arrays for the names of the
fields.
example you have input type='text' name='FirstName' size='20'
maxlength='20'
auto-populate data, as in putting in mock data depending on column type? or
transferring data from another data source.
If the former, you can look at 3rd party sources (I think I saw one from
winSQL), if the latter you can convert any data source to a (tab, comma,
etc.) delimeted file which you
I thought you could, but actually I dont think you can ... however there is
this little hack I just came up with.
FORM Example
form action = 'redirect.php
input type = 'submit' name = 'Page1' value = goto Page 1
input type = 'submit' name = 'Page2' value = goto Page 2
/form
Code for
it should be in the $_GET or $HTTP_GET_VARS array in the index.php script.
put this at the top of your index.php script
var_dump ($_GET); # or $HTTP_GET_VARS depending on PHP version
and see if the value is there. Also, if you are using the value in a
function and you have PHP 4.1.0 (I think),
It could be a warning in your script. On your local server, maybe you have
error reporting set to minimal (ie. don't report warnings), whereas the ISP
server might have it turned up higher by default.
near the top of your script reporter_view.php put in the line
error_reporting(E_ALL); ie.
?php
I wanted to attach one more point (esp. since this is an ecomm solution),
you should also check your POST variables (in addition to the GET varaibles)
to make sure they are clean and what are expected. It's not that hard to
change posted values.
Bobby
Daniel J. Rychlik [EMAIL PROTECTED] wrote in
In PHP there are two operators for comparisons, the double and triple
equivalance.
Double equivalance just check's the boolean type so if (0 == 'n') is
translated to if (False == False), where as triple equivalance checks the
data types as well so if (0==='n') becomes if
maybe compare the php settings for both servers (using phpinfo()). Also
check the register globals setting. I know this might not be a big help,
but it's a start.
good luck
Bobby
Anders Thoresson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Are there any big differences in
Since I haven't had any problems with br / I really don't care. However,
if you are concerned why don't you write a function like this:
my_nl2br($targetStr, XML = true) {
$buffer = '';
if (XML) {
return nl2br($targetStr);
}
else {
$buffer = nl2br($targetStr);
look at strlen() at php.net
Daniel J. Rychlik [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hmm, I just noticed that array dump counts the number of charaters and white
space and lables that number string... What function name is that ? The
string counter I mean ?
-Dan
--
PHP
you can you the Mysql MAX function, I believe
Select Max(ID) from Table;
Also, you may want to look at PHP's mysql_insert_id(), (if you are trying to
find the id number after an insert (if that's what you want)).
Chris Schoeman [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I want
What kind of 'logical' order do you need for the Post array?
To clarify:
Do you need to write to a file the POST variables passed to the script?
Kyle Babich [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I have a form (setup.php) that passes values to processSetup.php when they
are
$setup_filename = /path/to/file/on/the/server/;
$fd = fopen($setup_filename , 'a'); #a for appending to file, w to write
from the beginning checkout php.net for more details on fopen
$report = ;
#
#Apply any re-ordering of the Post array here to you 'logical' order
# look at the manual for
Yes that's right. this was just from the top of my head and it's early for
me.
it should be
$report .= key:.$index. = .$value.\n;
as Dan has pointed out.
Dan Joseph [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
$report = key:.$index. = .$value.\n;
actually, shouldn't it
Isn't Call-time pass-by-reference the following
$variable = myFunction1($x); Where
myFunction1() is defined as function myFunction1($x)
Where as pass-be-reference is called as
$variable = myFunction2($x); Where is defined as function myFunction2
($Obj);
I think the latter is better anyways,
create a script getFile.php
when this is called first update the database, then using header you can
stipulate what type of document it is and it will prompt for download
for example for a Word document
?php
#Query here to update the database
#then after successful output the headers
maybe try exec?
$instruction = $myOutput command ;
# for piping (as I recall) I used to do the input from the right, but I
don't think that will make a difference
exec ($instruction);
Bobby
exec (command
Tim T [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I have a mem var $myoutput
You can try using the cURL package with PHP. I use it with a system call.
$curl_path = /usr/bin/curl; # or full path of curl
$post = 'amount=3.40merchant_id=2351235'; #POST key value pairs with ,
these variables will be POSTed to site
$command = $curl_path -d \$post\ $gateway_url;
not with php directly, but you can do that with HTML meta tags, check google
for Meta refresh
Dale [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Does anybody know of a way to redirect to another page once you have
already
outputted html to the screen. In other words, I want to
this is discussed in the posted comments under the function section of nl2br
on php.net.
But from what I remember there is no br2nl() (unfortunately).
just goto php.net/nl2br and search the posted comments for br2nl
Bobby
Petre Agenbag [EMAIL PROTECTED] wrote in message
news:[EMAIL
If it's a preference it's a bad one. Have register globals set to ON is one
way of leaving your script open to being exploitable. I would suggest that
if you really need to use that code then either modify it or write something
from scratch and use that code as a guide line.
search php.net for
I agree that you can write secure scripts with register_globals set to ON.
I usually think that alot of rookie PHP programmers (I just started PHP a
year ago, myself) read the list, and the way I figure is that it is good to
make readers of the list aware of the issues of register globals.
Plus,
I am working on creating a thumbnail script but the obsticle is that
'convert ' doesn't create a file from the script. I am doing a system call
with the following
?php
exec('convert -size 400x293 /home/original.gif -resize 8x8
/home/thumb.gif');
exec('cp /home/test1 /home/test2'); # Copying an
try this
$string = ereg_replace ('\r\n|\n|\r', 'br', $string);
OR
$string = nl2br($string);
NOTE: for me the first case will remove the newline, whereas the second will
keep them (It might be becuase of my old php version [4.06]?)
Zavaboy [EMAIL PROTECTED] wrote in message
news:[EMAIL
###HTML snippet
form action = redirect.php
Enter Number : input type=text name=number
/form
###PHP
?php
$number = $HTTP_POST_VARS['number']; # or $_POST['number']; depnding on PHP
version
header (Location: http://www.mypage.com/.$number);
exit();
?
### NOTE: I just wrote this on the fly so
I would think that they are 16 key/value pairs when the MySQL (TEXT) fields
are null thus the session variables are NOT set thus NOT present.
Hypothsis: I believe that your are using mysql_fetch_array($query_resource),
try using the second parameter as well ie.
mysql_fetch_array($query_resource,
mysql_fetch_array() but changed to mysql_fetch_assoc()
The funny thing is, I have a page that does the var_dump() and all
I'm doing is refreshing the page and sometimes I get 18 other times
16 variables
Gavin
Auckland, New Zealand
-Original Message-
From: Bobby Patel [SMTP:[EMAIL
, Pakuranga, Auckland, New Zealand
-Original Message-
From: Bobby Patel [SMTP:[EMAIL PROTECTED]
Sent: Friday, March 21, 2003 3:28 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: Missing session vars when doing var_dump()
Are the queries the exact same every time you refresh them
You have register_globals set to off (read up on register globals in
php.net).
your code should read
$HTTP_POST_VARS['action'] or $_POST['action'] (depending on PHP version)
INSTEAD of just $action.
so to test an if::
if ($HTTP_POST_VARS['action']==1) {
/*
Code for if action is equal to 1
*/
}
There is another php mailer class which is really good (and includes
authentication among alot of other things).
http://phpmailer.sourceforge.net
Aitor Cabrera [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi, I'm trying to use the mail() funtion but I can only use this funtion the
header(location: http://www.website.com http://www.website.com/ );
I usually use header() like this :
header(location: http://www.website.com;);
you can try that, maybe it might work.
Kelly Protsko [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Basically what I am doing is having
are you sure that $row['user_type'] has a (non-null) value?
Mike Tuller [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I have a login page and have sessions working so that if a user is in
the database, they can login. I want to also add a user_type to the
session so that I can have
eregi_replace([^[:alnum:].], , $string_val);
notice the period after the first closing brace.
Kenn Murrah [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Thanks ... one more thing: is there a way to modify this to allow a
period
(dot) to included, as well as the alha and num
you can look at isset() and empty(). If you retrieve the query result with
Mysql association (ie. $field=mysql_fetch_array($resource, MYSQL_ASSOC),
then even the field has a blank value, there will be a blank variable
created ($field[Name] is created but with no value)), however if you grab
the
$fields='';
$values='';
foreach ($_POST as $field - $value) {
$fields .= $field., ;
$values .=$value., ;
}
$fields = substr ($fields, -2); // strip off last comma and space
$values = substr ($values , -2); // strip off last comma and space
$query = INSERT INTO $_GET[table_name]
Add an exit statement after the header call. But I thought the same thing
that after header nothing would be executed.
if (!LoggedIn()) { // If not logged in, take to Login page.
header(Location: /login.php);
exit();
}
I just gave you this soultion to solve your
I believe PHP and MySQL use two different definitions of the start of a time
stamp. One uses 1974 the other 1900 (I don't know exactly). If you echo
strtotime($attributes[startdate]) , UNIX_TIMESTAMP (datestamp)
Also, in your query you are looking for all headlines that have
What I would recommend is PHPmyAdmin. I believe it's open source and written
in PHP specifically as a utility for mySQL.
I'm sure you can find it at sourceforge.net (or a similar site) .
Jeremy N.E. Proffitt [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I need to create some simple
function getID($variable){
return $HTTP_GET_VARS[$variable];
}
Patrick Teague [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I know I've seen something about this (I can't remember whether yea or
nay),
but I can't remember where I found it as at the time I was looking for
As the previous post of using die would be better. Also try using
mysql_pconnect (for persistant connections) and also, if you are running
more than one query per script execution, then DON'T keeping trying to
connect/select database.
I suggest you do the first two things at the start of ALL the
I have an idea that might work in theory. Provided that you have php running
on a Unix based OS. You could forward all emails to an email that sits on a
Unix server. There they are stored as plain text files, then just parse what
you need on a daily basis and truncate that file to 0 bytes.
BUT it
Are you on a Windows platform, or *nix. I would assume *nix since you
mentioned chmod.
what did you chmod the file to? who owns the file? and what user does PHP
run as (maybe nobody, or httpd)?
Just to get it to work chmod the file to 777, BUT this is a security risk.
MAKE SURE this file is NOT
What you could do, is get the current time stamp using time() or date() and
create a sesion variable with this value, when they login (and the session
is created. Then when they logout, and the sesion is destoyed get the
current time stamp again and minus it from the start time.
Note: This
Check out explode()
$file // say this variable has your file contents
$lines = explode (\n, $file); // lines contains each line of the file
foreach ($lines as $line - $content) {
if (strrpos($line, ':')) {
$values = explode (':', $content);
echo The first value is :
try looking at the status of register_globals on both versions.
Chip Wiegand [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Jason Wong [EMAIL PROTECTED] wrote on 02/05/2003 12:49:16 PM:
On Thursday 06 February 2003 04:41, [EMAIL PROTECTED] wrote:
After
look at array_key_exists
Narciso Miguel Rodrigues [EMAIL PROTECTED] wrote in
message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Is possible to do something like
if ($username in $users) ... or i need to do a foreach($user){...}
Thks
[MsR]
--
PHP General Mailing List
This variable is registered in the Session, and the variable isn't active
until the page refreshes. It's hard to explain. I thought I would try.
There are some things you can do. If you need the variable right away, you
can do this:
if (isset($HTTP_SESSION_VARS[user1])) {
$user1 =
Since you have 'safe-mode' on, Register globals will be turned off, so you
should test $HTTP_POST_VARS['Submit'], instead.
John M [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
I have the code below. It's a simple file upload. But it doesn't work.
Before
It seems you have register globals set to off, thus when you have variables
$price and $qty they are just fresh variables, you might try
$HTTP_POST_VARS['price'] and $HTTP_POST_VARS['qty'] (don't forget the single
quote).
Cesar Aracena [EMAIL PROTECTED] wrote in message
I have done something similar:
write a script that takes an Article ID, and displays the text. So to
displat article #3, you would call it like getArticle.php?id=3.
Skelton for getArticle.php
- take id and store in $id
- Select FullBody from Articles where ID = $id
- $body = query['FullBody']
-
One quick note, if you DO NOT have access to a database, you could store
that incremented number to a file. And open and retrieve, and increment
every time you need. If you need to take this approach checkout php.net and
search for fopen.
Don Mc Nair [EMAIL PROTECTED] wrote in message
[EMAIL
It seems that error is from an ill-formed MySql statement. Try this,
$descripQuery = SELECT descrip from project_descrip where rowid=$foo;
echo $descripQuery ; // put in this echo after the query.
$descripResult = mysql_query($descripQuery);
echo mysql_error(); file://put this echo after query
That makes sense. When Marek explained it I didn't realise that IMG tags
can't use the raw data, and needs to make a seperate HTTP request for the
Headers.
Now, I understand. Unfortunately the desicion has been made to go with the
database.
Oh well, I can always code the scripts to store and
I believe there something (a meta tag?) called meta-refresh or just
refresh.
But I believe you have to set the refresh interval. and if you set the
interval to small it might eat your server's resources.
OR I just thought of this, sometimes when you get to a page (usually with
forms?) it says
approach is reasonable. I guess I will have to judge for myself!
Bobby Patel [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hello,
I have the Images table setup with columns (width, height, size, type,
etc...) the question is should I have the image dat
Hello,
I have the Images table setup with columns (width, height, size, type,
etc...) the question is should I have the image data stored in this table or
disk?
I know, alot of people have said it is faster in disk, which is 1 page I/O.
But I need these images for displaying product pages, and I
lesystem
Don't worry about what it looks like - I extracted this from the frameset
it goes in
Cheers!
RW
Quoting Bobby Patel [EMAIL PROTECTED]:
### Hello,
### I have the Images table setup with columns (width, height, size, type,
### etc...) the question is should I have the image dat
Hey, I have been using HTMLTMPL
http://htmltmpl.sourceforge.net/
So far it works well, and emulates the more powerfull Perl Templating
system.
It seems alot of code, but whips up these templates in good response time
(of course, it might be becuase I work on a unstressed server).
Chad Day
in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
On Monday 06 January 2003 14:01, Bobby Patel wrote:
Hello, I want to emulate a POST request to Paypal. Originally a POST
request is sent from the user (through a form) and the user is
redirected
to paypal's site. Now, what I wa
Hello, I want to emulate a POST request to Paypal. Originally a POST request
is sent from the user (through a form) and the user is redirected to
paypal's site. Now, what I want to do is to emulate a POST request (so that
the surfer can't see some of the hidden fields of the form) and to deter
Hello, I want to emulate a POST request to Paypal. Originally a POST request
is sent from the user (through a form) and the user is redirected to
paypal's site. Now, what I want to do is to emulate a POST request (so that
the surfer can't see some of the hidden fields of the form) and to deter
Hello, I want to emulate a POST request to Paypal. Originally a POST request
is sent from the user (through a form) and the user is redirected to
paypal's site. Now, what I want to do is to emulate a POST request (so that
the surfer can't see some of the hidden fields of the form) and to deter
If you have access to a database on your server then you can do the
following:
- user logs in to site (user enters unique username and password)
- once in they will be displayed with the 3-6 Questions
- after they answer the questions they hit submit which sends it to a PHP
script
- the PHP script
try this:
$mmdd = $foo.$bar.$bleh.$doh; /*note double-quotes and the concat
operator (the period) */
$$mmdd = a_date_value;
To test;
echo $mmdd ;
echo $$mmdd; /*provided that a_date_value is a string literal*/
Robert McPeak [EMAIL PROTECTED] wrote in message
73 matches
Mail list logo