Can you show us what you're calling it with?
Al Padley
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
http://www.web-buddha.co.uk
Wow, there are some really bitchy, unattractive people here. No wonder some
people bail out of IT. Don't confuse knowledge for wisdom.
On 1/9/07, tedd <[EMAIL PROTECTED]> wrote:
At 9:17 PM -0500 1/5/07, <[EMAIL PROTECTED]> wrote:
>You'll probably get 50 answers to this, but here's probably what
Read the reponses.
Why not check php.ini to see whether display_errors is set to off and switch
it on until you are back in business? Check the httpd.conf file to make sure
Apache is parsing .php files correctly.
mysql_select_db
This may be more of a mysql issue, but I am using php for my app so here
goes...
I have a fee field in the database, and when users post events they can
specify entrance fee in £. In some, not all, of the fields I am getting, for
example, £7 rather than £. Is this an encoding issue?
Many thanks
Thanks guys. The issue is that users can specify text as well as currency in
the input field ie '£2 students / £5 general admission'.
Hi all, I posted a question a couple of days ago regarding a web app I have
wherein users are able to indicated prices and concessions via a text field,
and the resulting encoding issues I have experienced, the main one being
seeing the pound sign as £ if viewing the results in a browser with the
This is what I use:
$site = (!preg_match('#^http://#', $_POST['c_site'])) ?
raw_param(trim(strip_tags("http:\/\/" . $_POST['c_site']))) :
raw_param(trim(strip_tags($_POST['c_site'])));
don't worry about raw_param, that's a function of my own, but you get the
idea.
Hi all. I am building an online events directory and as part of the system
users can search for events by date, category etc.
The logic involved in finding events that match the user-entered dates works
like so:
1. we create a range of dates from the start and end dates specified by the
user
2.
Thanks for that - can't do that as all I know in the database is the start
and end date for each event (so I don't have to create mapping tables and
perform massive joins), the rest is handle dynamically.
I think I can do it using usort, this seems to work, any comments?
function compare($x, $y)
Hi all. I have an odd problem.
I am building an events directory and when users search, they provide a date
range ie Feb 16 2007 to March 12 2007 as one of the options for searching.
The system then creates an array of timestamps from this and then polls the
database for all events whose lifetime
I AM using the logic you and Jochem suggest in the query, I am not
performing any joins. I query for certain criteria re the start and end
dates held in the database, and once I have my set I then work with it
dynamically as I need to know, based on the event frequency, how many events
from that r
Thanks all for your input - you're all correct, I don't really need to use
timestamps as I am only interested in dates so will be reworking the app to
use dates only. I still need to generate sequences of dates and really don't
want to deal with DST, so my question is: can I add days to dates with
I assume you mean you want to hold that html in a variable? Use a heredoc.
Also, if you want to get into the habit of writing valid xhtml, use
lowercase and selected="selected"
Hi all. I am running an online charity lottery and am having issues with IE6
and sessions.
To fix them, I added the following at the top of each file:
ini_set('session.name', 'tlc');
header("Cache-control: private");
session_start();
...ran a local test in IE6 worked fine, then noticed more bla
$web = fopen('http://google.com/index.php', 'r');
$contents = file_get_contents($web);
if (preg_match('/$link/', $contents))... you got it
simplified and no error checking but you get the idea.
On 2/24/07, Otto Wyss <[EMAIL PROTECTED]> wrote:
With method="post" just $kind works fine (register_global) yet I've also
tried any combination of $_GET['kind'] and $_POST['kind']. With
method="get" it doesn't work.
O. Wyss
Peter Lauri wrote:
> How are you fetching the GET and POST? With $_GET
On 2/24/07, Dotan Cohen <[EMAIL PROTECTED]> wrote:
Also, if you're using the variable in a print string, then you'll need
to exit the string, like so:
$print "Hello, $kind!";
would become:
$print "Hello, ".$_GET["kind"]."!";
Dotan Cohen
http://easyanswers.info
http://nirot.com
--
PHP General
On 2/25/07, zerof <[EMAIL PROTECTED]> wrote:
Alain Roger escreveu:
> Hi,
>
> i stored all my pictures in my PostgreSQL DB as bytea type.
> Now i would like to know how can i display them in my PHP pages ?
>
> where can i find some example ?
>
> thanks a lot,
>
--
It is not a good
You have a typo in your code...
OK. Blank entries means that as date is passed in and validated via forms,
it is then entered into $_SESSION so data can be persistent as the user goes
back and forth. These values are eventually entered into the database and
are blank, whereas the few values that are entered from $_POST (ie credi
On 2/28/07, tedd <[EMAIL PROTECTED]> wrote:
At 11:22 PM -0500 2/27/07, John Taylor-Johnston wrote:
>I need an anti-spam-spider measure for my site. Too many addresses
>are getting raked. In once instance, I created a flash page:
>http://erasethis.glquebec.org/English/contact.htm
>But I just don'
Of course it's possible to output raw html in a php file, that's one of it's
fundamental uses! In fact, it's more efficient to switch the php parser off
and send raw html as the php parser doesn't need to get involved.
If you are running that from the command line, why do you need html? Not
sure why you're doing that.
Why not learn in a web environment if your goal is to build a website? Just
create the following file:
save it, upload it and view it. If you see the php details you have the
system set up as you need it and can just start writing php-driven web pages
(the file you are using now is one!).
If y
Hi guys, I have just read 'Programming PHP' (O'Reilly) and although I think
it's a great book, I am confused about variable variables and references -
not the mechanics, just where you would use them.
The subject of variable variables is explained but no examples are given as
to why and where you
If you do want to use the header function after html has been output, you
can always look at using output buffering (ob_start()).
ucwords(strtolower($string))
or
ucfirst(strtolower($string))
On 3/13/07, Todd Cary <[EMAIL PROTECTED]> wrote:
I would like to write a filter that takes the text "smith" or
"SMith" and returns "Smith"; same for "ralph smith". Is the a
good source on using filters this way?
Thank you...
--
P
Turn off register_globals - if you pollute your scripts with global
variables like that you are asking for trouble. If you can't make sure you
clean the variable.
Using include("$page.php") is asking for trouble.
If you can get register_globals switched off (it's off by default in PHP5
for this
Have a look at this:
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Om
On 3/20/07, Jochem Maas <[EMAIL PROTECTED]> wrote:
Tijnema ! wrote:
> On 3/20/07, Dave Goodchild <[EMAIL PROTECTED]> wrote:
>> Have a look at this:
>
> Have a look at nothing :)
I believe this Dave's way of pointing people to the Great Void :-)
>>
use: $_POST['max_id'] ==
or even better:
if (empty($_POST['max_id']))
Because isset will return true if the variable is set, even if it is blank.
Empty will return true is the variable holds an empty string.
Because of this:
$sql = mysql_query("INSERT INTO tbl (WHEN, WHAT, WHO) VALUES
('$WHEN','$WHAT','$WHO')");
$result = mysql_query($sql) or die("Fatal Error :".mysql_error());
...you are running the query and assigning the results into $sql and then
running mysql_query again in the line below. S
Hi all, I have an array containing a sequence of dates in the following
format, for example:
Mon 26 Nov 2007
Mon 24 Dec 2007
Mon 31 Dec 2007
Mon 28 Jan 2007
...and I want to remove any the first element in cases where the Mondays
fall in the same month, so in this case I want to be
left with:
M
Amazing, just what I needed - many thanks. Have been coding non-stop for 10
days and things are getting foggy. Grats for your informed and quick
response and have a fantastic day!
Not true. You can submit the form back to itself as many times as required
by making the form action $_SERVER['PHP_SELF'] and checking for various
sequences and outputting different html in each case.
I have just upgraded to Drupal 5 and so far am very impressed - D5 comes
bundled with the jquery library and I have found drupal to be very powerful
with a wide and supportive community.
Provide some code...?
Can you re-iterate what is happening - I have a site with 1and1 and use
header() with no issues.
That is, unless you use output buffering. It may not be the most elegant
solution (using header() to redirect users increases server calls), but I
built a template-driven php site that calls:
...depending on certain conditions which means I can then use header() even
after I have started output
Tables used for presentational layout are a hack, implemented in an albiet
ingenious way to overcome the shortcomings of the Web quite a while ago now.
Tables should be used for the display of tabular data, ie spreadsheets,
calendars etc.
Table layout increases download times, the deeper nested
Can we kill this now please? It's not a php issue, is an old and endless
argument and is better addressed on a css / design list.
You mean a javscript library? If so, check out jquery and moo.fx.
On 10/23/07, Merlin <[EMAIL PROTECTED]> wrote:
>
> Hi there,
>
> I am looking for a framework to integrate some AJAX Functionality into
> my PHP4 MySQL Apache webapp. First thing I would like to do, is an edit
> function that opens
Support for php4 will be dropped at the end of the year so hosts will be
forced to make the upgrade at some point.
On 10/29/07, Hulf <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
>
> It is about time I made the jump to 5, however the only thing that is
> holding me back is the problem with hosts. How many
Start by coding proper semantic xhtml and you will have less headaches
too - that code looks very ugly.
On Nov 12, 2007 8:38 AM, Ronald Wiplinger <[EMAIL PROTECTED]> wrote:
> Chris wrote:
> > Ronald Wiplinger wrote:
> >> My php program is working with Firefox, but not with Internet Explorer.
> >
>
Start with Programming PHP and then get Upgrading To PHP5 (both by O'Reilly)
On Nov 17, 2007 2:31 PM, David Giragosian <[EMAIL PROTECTED]> wrote:
> On 11/17/07, joychen <[EMAIL PROTECTED]> wrote:
> >
> > tell me :which book is good for newman??
>
>
> You mean paul?
>
--
PHP General Mailing List
Hi guys. I have the following XML file which I want to convert into a
multidimensional array. I am using PHP5 so don't want to use
SimpleXML as apparently there are issues with sessions and after
conversion I want to pass this array into the session. Any ideas on
the best and cleanest way to do thi
Why not try a css list? css-discuss for example?
On Dec 18, 2007 8:06 PM, Børge Holen <[EMAIL PROTECTED]> wrote:
> On Tuesday 18 December 2007 20:03:53 Stut wrote:
> > VamVan wrote:
> > > Please apologize for sending this question to PHP forums.
> >
> > If you know this already why ask the questi
If MVC is too heavy for you it may also be worth exploring templating
engines such as Smarty:
http://www.smarty.net/
On Jan 2, 2008 4:10 PM, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> On Jan 2, 2008 2:17 AM, Alain Roger <[EMAIL PROTECTED]> wrote:
>
> > Hi,
> >
> > i would like to improve my codi
don't use nonbreaking spaces use CSS to style the input button then
you wont have to deal with redundant presentational gunk in your data
On 1/2/08, David Giragosian <[EMAIL PROTECTED]> wrote:
> On 1/2/08, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> >
> > On Jan 2, 2008 1:34 PM, tedd <[EMAIL PROTECT
Also, supply an absolute URL when using header redirects.
On Jan 5, 2008 3:44 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Jan 5, 2008 9:06 AM, peeyush gulati <[EMAIL PROTECTED]> wrote:
> > Greetings on New Year :)
>
>To you, as well!
>
> > We have a script, say layer.php, which uses HTTP
It's advisable as the page you will be redirected to will be relative to the
one the browser actually requested, so it's a good habit to get into.
On Jan 5, 2008 4:05 PM, Daniel Brown <[EMAIL PROTECTED]> wrote:
> On Jan 5, 2008 10:59 AM, Dave Goodchild <[EMAIL PROTECTED]>
Don't be scared of functions, no magic or mystery there, all you are doing
is putting your code in a function like so:
function add($a, $b) {
return $a + $b;
}
..for example and calling it like so:
$a = 12;
$b = 100;
$sum = add(12, 13);
...etc etc, not too much more to learn than that and now I
Methink you're a little confused. A function is a piece of code that
performs a specific job that can be called. You may send it
data, you may not. It may return data, it may not. If your link goes to
logout.php, that script may use functions to do it's job.
You can't call a function in a link as p
Said it was a crude example and I was pushed for time
On Jan 24, 2008 8:13 PM, Eric Butera <[EMAIL PROTECTED]> wrote:
> On Jan 24, 2008 3:08 PM, Dave Goodchild <[EMAIL PROTECTED]> wrote:
> > header("Location: index.php");
>
> Redirect uri's should be absolute.
>
session_register is old school. RTFM.
On Mon, Mar 10, 2008 at 4:26 PM, Al <[EMAIL PROTECTED]> wrote:
> Read the current php manual.
>
> Lamonte H wrote:
> > Is it necessary to use session_register()? What exactly was the point
> of
> > this function if you can set sessions using $_SESSION it sel
Will you two pricks cut it out. How fucking tedious.
On Wed, Mar 12, 2008 at 9:34 PM, Robert Cummings <[EMAIL PROTECTED]>
wrote:
>
> On Wed, 2008-03-12 at 22:26 +0100, Aschwin Wesselius wrote:
> > Robert Cummings wrote:
> > > On Wed, 2008-03-12 at 16:11 -0500, Greg Donald wrote:
> > >
> > >> On 3
in php you have a number of constructs that can be used to execute code (or
not) based on certain conditions ie is_defined(). Not sure if
the comparison with C holds true as C is compiled and PHP is interpreted.
On Fri, Mar 14, 2008 at 6:34 PM, Eric Gorr <[EMAIL PROTECTED]> wrote:
> If you are ta
Why are you writing a logging class? Why not use error_log and enable error
logging?
On Fri, Mar 21, 2008 at 1:11 PM, Al <[EMAIL PROTECTED]> wrote:
> int file_put_contents ( string $filename, mixed $data [, int $flags [,
> resource $context]] )
>
> This function is identical to calling fopen(), f
You can also use that in interpolations where the variable name may be
ambiguous ie
"My name is Stephen and I am a {$type}drone"
..or to interpolate array lookups:
"This is {$desc['mood']} don't you know!"
View the source, you have this:
which is not closed, therefore everything after it will be blue.
Hi all. I have built an online events directory in php (
http://dontjustsitthere.co.uk) where people can find local events and also
post their events. The app is composed of a single page, index.php, that
generates different content depending on the parameters passed to it and
uses sessions for pe
The characters are encoded in octal and the php interpreter converts them
into the corresponding ASCII characters and then the sequence is represented
as a string which is included?
Another small and unrelated point - you don't need to use double quotes
inside the array brackets - you're not processing them at all.
It's a personal thing. I use Code Igniter (codeigniter.com), which is fast,
lightweight, has a great community and excellent documentation, as well as
some very good video tutorials.
It pales in comparison with Ruby On Rails, of course, but that's another
thread on another list...
What function(s) are you using to read the file contents? How are you
inserting them into the array? Code examples please...
You could also try Drupal. Drupal 5 comes bundled with jQuery. Drupal is
powerful and flexible and the community is large and supportive.
If there is no need to return a value then I don't do so. However, the
function is going to process something, and surely you should check that the
processing has succeeded or failed?
Your problem is this:
$result_row[] = mysql_query($query) or die(mysql_error());
...you are assigning a query to a variable. What you need to do is
something like this:
$result = mysql_query($query) or die(mysql_error());
while ($result_row = mysql_fetch_array($result)) {
.
}
umask
Why not use umask?
Unless some server config error causes that stuff to be output on the page?
I tend to put such functions in a .inc file and amend the .htaccess to
prevent download.
Sure, I usually put these files outside the docroot - unless I am in some
f**ked-up hosting environment that doesn't let me change the include path...
I use something like this:
$_SESSION['profane'] = false;
foreach ($_POST as $value) {
foreach ($swearbox as $profanity) {
if (preg_match("/$profanity/i", $value)) {
$errors = true;
$_SESSION['profane'] = true;
mail(TECHEMAIL, 'profane content
No, because extra processing is done on the other side - now
fuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuckfuck
On 29/06/06, Chris <[EMAIL PROTECTED]> wrote:
Russbucket wrote:
> I took an example of a script from the PHP documentation and try to
connect
> to my database. If I leave in the or die part of line 3, I get
nothing, if
> I comment out that part I get the echo message on line 4.
>
> // Connec
On 29/06/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
[snip]
But I am loosing hope that it can be done now :)
[/snip]
I will go ahead and remove all hope. If you do not own the cookie, you
cannot see it or use it. It is a rule of this jungle that has been in
place for years.
Yes, let's put thi
On 30/06/06, John Nichel <[EMAIL PROTECTED]> wrote:
BBC wrote:
> Hi again..
>
> I'm wondering is it possible to make one page which connects to many
> DataBase?
>
Yes. If you are using mysql, why not create connection functions that sit
outside the server root (in the include path) for secur
On 05/07/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
[snip]
can I create a script that will search a php page for iframes. And
have it check the path of the iframe, If the iframe is listed as bad
don't show. (list I make)
Trying to do something with virus like through an iframe.
I don't real
On 12/07/06, Jay Blanchard <[EMAIL PROTECTED]> wrote:
[snip]
A bit off topic, but I hadn't heard about short tags being a bad idea.
What
reasons make short tags worse than the regular tags. Just curious.
[/snip]
Two words, XML.
Yep, they can interfere with xml processing, and they also make y
On 13/07/06, Ed Curtis <[EMAIL PROTECTED]> wrote:
I know this is probably simple as all get out but it's early and I can't
find an answer anywhere after searching for a while
I need to assign a number to a variable and then use that variable in a
session to store an array. It's for a shop
On 13/07/06, João Cândido de Souza Neto <[EMAIL PROTECTED]> wrote:
Hello gang.
I´ve got a e-commerce system where one can import data from his management
system.
This importation files sometimes has a size about 8Mb. Unfortunatly, when
one try to put this file into e-commerce, generaly one get
On 14/07/06, Steve Turnbull <[EMAIL PROTECTED]> wrote:
Hey folks
I don't want to "just get you to do the work", but I have so far tried
in vain to achieve something...
I have a string similar to the following;
cn=emailadmin,ou=services,dc=domain,dc=net
I want to extract whatever falls betwee
Hi all. I know htmlspecialchars converts the smallest set of entities
possible to generate valid HTML, and that htmlentities goes much further, so
what is the difference? Is it not better to use htmlentities in every case,
making htmlspecialchars somewhat redundant, or is there a performance
trade
Hi all. I am about to start writing an events listing application
(nationwide) and want users to be able for example to specify events within
a 5, 10 and 15 mile radius of their postcode. Does anyone know of a set of
classes/library that can provide this, would rather not fork out on a
bespoke pie
On 02/08/06, Jochen Kaechelin <[EMAIL PROTECTED]> wrote:
.. to build a url like http://devil.server.com/vitims_page.php??
Not sure what you're trying to do, but switch register_globals OFF. Also,
if you are trying to concatenate strings inside the function, use ., not +.
--
http://www.web
On 04/08/06, Chris <[EMAIL PROTECTED]> wrote:
Dave M G wrote:
> PHP List,
>
> Recently I wrote a piece of code to scrape data from an HTML page.
>
> Part of that code deleted all the unwanted text from the very top of the
> page, where it says " of a "" tag.
> Is there any reason why either ere
On 08/08/06, Dave M G <[EMAIL PROTECTED]> wrote:
PHP,
Shouldn't this regular expression select everything from the start of
the string to the first space character:
$firstWord = preg_match('#^*(.*) #iU', $word);
It doesn't, so clearly I'm wrong, but here's why I thought it would:
. stands fo
On 08/08/06, Reinhart Viane <[EMAIL PROTECTED]> wrote:
A. I have a page on which people can supply dates in a text area. Dates
are
entered like this:
3/01/2005
29/12/2005
2/01/2006
20/02/2006
28/12/2006
1/01/2007
15/02/2007
B. Now I need this Post element to be broken into pieces (per date) and
On 09/08/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
Hi,
How do I add so that it checks for a comma , in this preg_match. I think
the
documentation is not that good for the pref_match:
preg_match('/^[a-z0-9-_\'() +]*$/i', $s);
Check for a comma inside a range - use a comma!
--
h
On 10/08/06, Peter Lauri <[EMAIL PROTECTED]> wrote:
Hi there,
You are correct that I am stupid to call the manual bad, it was not meant
like that. It was that it was not suited to me, and that I actually just
wanted to find a solution to my problem directly, and it did not give me
that. I have
On 12/08/06, John Taylor-Johnston <
[EMAIL PROTECTED]> wrote:
Is there something already created to open an rss file, parse it, and
include() the useful stuff into an html file?
Not all my students have an rss reader.
http://jtjohnston.ca/jtjohnston.rss
Yep. The PEAR XML_RSS class.
for
Hi all - I have several require_once statements in my web app to load in
small function libraries. A common one bundles a variety of functions to
handle date math and map month numbers to month names. I originally defined
an array in that file plus a bunch of functions but when I loaded the page,
On 15/08/06, Richard Lynch <[EMAIL PROTECTED]> wrote:
On Mon, August 14, 2006 8:40 am, Ville Mattila wrote:
> Does the PHP environment (5.1.4) provide a way to define some custom
> variables as a superglobal? It would be useful for saving certain site
> preferences and settings that must be refe
On 15/08/06, Ross <[EMAIL PROTECTED]> wrote:
Hello,
I have a couple of questions
first how do I check two tables is it?
$sql = "SELECT * FROM mytable, mytable2 WHERE username = '$username' AND
userpass = '$userpass'";
Secondly my table just sends and returns straight values from the db but
Hablo espanol, pero lo que Rory dice es verdad, hay otra lista en espanol.
Pero, si quieres, you tratare entender tu palabra.
In short, speaking a language other than English on this list( especially
considering that there is a php.general.es -
http://news.php.net/php.general.es ), is similar t
I don't speak enough Spanish to understand it all, but tratare according
to altavista is "to treat" - not really sure I get it.
Sorry, should be 'yo tratare', tratar also means to try - I will try and
understand...
--
http://www.web-buddha.co.uk
http://www.projectkarma.co.uk
1 - 100 of 246 matches
Mail list logo