mike wrote:
you're still issuing an HTTP request to get it, or executing perl on
the command line...
if it's a true non-profit 503(c)(3), you could offer someone the
chance to write off their services... non-profits may not have a lot
of money to spare but they do typically have money to fund
mike wrote:
yeah - well you said you can't issue an http request
although it depends - if your reporting is
javascript/browser-executable, or if it's a server-side increment. if
it's javascript, no worries, the curl request won't execute it.
On 1/10/08, Liam [EMAIL PROTECTED] wrote:
mike
How do I use a get parameter in a include?
e.g.
?php include('x.cgi?want=ssilinks') ?
I can't modify the cgi file though, and HTML includes don't work on my
server.
Thanks in advance.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi!
I have a cgi script that returns a particular value when I call it as
x.cgi?want=ssilinks. I need to call it like that, but whenever I put
the GET parameter into the include path, I get a warning saying that the
file could not be found. Any help?
Thanks,
Liam
--
PHP General Mailing
mike wrote:
that is a horrible method.
Thanks for the nice positive, refreshing and most helpful response.
in my opinion i would say redesign it properly.
Well what the hell do you suggest I do??? The script is MEANT to be
used this way, as it has an admin panel inside etc.
Oh, by the way,
Jim Lucas wrote:
Liam wrote:
Hi!
I have a cgi script that returns a particular value when I call it as
x.cgi?want=ssilinks. I need to call it like that, but whenever I put
the GET parameter into the include path, I get a warning saying that
the file could not be found. Any help?
Thanks
On 1/9/08, Liam [EMAIL PROTECTED] wrote:
mike wrote:
that is a horrible method.
Thanks for the nice positive, refreshing and most helpful response.
read the sentence below it.
in my opinion i would say redesign it properly.
Well what the hell do you suggest I do??? The script is MEANT
How can I display the returned HTML contents of a cgi (Perl) script,
without get parameters?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Liam wrote:
How can I display the returned HTML contents of a cgi (Perl) script,
without get parameters?
Oh, this means that
1: It mustn't count as a http hit,
and 2: I need to only get what is between the body tags.
Thanks in advance.
--
PHP General Mailing List (http://www.php.net
OK, what I meant was
1) Not count as though the user manually navigated to that page (for my
sanity when checking the site statistics!)
and
2) I also need to know how to run a expression-ish thing so that when I
'parse' the text, it returns all text between x and y, but parse it
BEFORE it
OK, what I meant was
1) Not dump the contents to a file, as the cgi will dynamically show
different links every time, (it's a reciprocal linking script)
2) Not count as though the user manually navigated to that page (for my
sanity when checking the site statistics!)
and
3) I also need to know
My non-profit setup makes that 'Pay Someone' alternative. What I am
planning on doing:
When the script is called, it is equivilent of using the want=ssilinks
GET parameter.
So therefore, all I need to do is get the HTML returned from the script,
not the contents of the script itself. Can
regards,
Liam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
{
// ERROR CODE
}
Many thanks for your help on this mater.
--
Kind regards,
Liam
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.
I've tried with and without addslashes, and htmlentities. Is there a
solution or I will I have to resort to getting him to use
{{$first_name}} etc.
Lastly, if I have to use {{whatever}} then what's the reason I can't
use $field_name in the database?
--
Kind regards,
Liam Delahunty
--
PHP General
Richard, thanks. This made it much clearer. I read this, then stepped away
and thought about it later and it makes so much more sense. Basically, I
guess I ended up with the result IMG SRC = Resource id #x in my HTML.
Man, I thought I was telling it to print the results of the resource ID, but
it
I'm trying to do a search-and-replace for a certain string (#1) from a bigger
string (#2), take that string (#1), do an SQL search, then do a little fiddling
to make another string (#3), and put that string (#3) back into the big string
(#2) to replace the certain string (#1).
Here's what I
Hello,
I'm having a real frustrating time with my problem here, which is to copy one
JPEG to another resource. I'm not even sure where I'm going wrong, or how to
find it out, because it seems that I'm getting all my resource IDs fine (when I
echo them, I get 'resource ID #x'), and no error
into onserver.txt and all other ones to be put into 404.txt
Unfortuantly I seem to be a little lost and confusded, can anyone see where im going
wrong as far as my stristr(); usage is and if so what is the problem?
Liam
The variable is infact created, but rather than being $id
the variable will be $_GET['id']
because it is part of the $_GET array,
so if you had output2.php?name=fred
the variable to acsses the word fred would be $_GET['name']
Hope that helps
Liam
- Original Message -
From: Ryan Francis
This may be a stupid question, but I'm trying to set up a system where I
can
take a poll from visitors to my website and then set a cookie so that they
can't vote more than once (until they clear their cookies at least).
Problem is, I don't want to put it at the top of my page, because what if
I think php.net/htmlentities will do this.
Apparently it *is*, but it won't for me. Any problems with this code?
$result[] = é;
$result[1] = htmlspecialchars($result[0]);
$result[2] = htmlentities($result[0]);
Both return the accented E unchanged.
--
PHP General Mailing List
I bet they do, did you check the HTML source as well? My guess is that the
source is reading the actual expected output, but your browser views é,
as
it should of course.
Sorry, should have mentioned. The source code reads the actual character,
not the eacute;.
--
PHP General Mailing List
I get all the content of file, so everything is in array 0. I need to
somehow break up the array by the comma.
Wouldn't it be $file_contents = explode(,, $file_contents[0]);
as in you've forgotten the array element?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
I have no idea what might be the problem, what does your translation table
look like?
Mine is still coming out as a single character. Here's my code, in case
anyone can spot any stupid human error blunder I'm making:
$translationtable = get_html_translation_table(HTML_ENTITIES);
$string =
I don't think this has been discussed, although I'm not really sure what you would
call these accented characters, so I haven't been able to do a complete search of the
archives, so apologies if this has been previously discussed.
Is there a function that not only turns into amp;, into quot;,
$dbqueryshipping1 = select * from tempuserpurchase where
(usersessionid=\$User_Shopping_Id\) and day=\1\ and
type'Meal Plans'
Tryed both methods and it is still not excluding anything matching Meal
Plans
Been a short while since I used SQL with my PHP, but try putting NOT instead
I need it to echo out a table with all the A's first, then a blank line,
then all the B's, a blank line and so on. I could write 26 different
queries, one for each letter of the alphabet, but surely there is a tidier
way.
Do a query, sorting by the field you need alphabetized. Then do this (and
I'm trying to find a function, similar to vb's 'mid' function that you can
return X amounts of characters at position Y from string Z. And I can't seem
to find one.
Any help?
I'm sure it's simple... so a little helper would be grand!
Cheers, Liam
--
PHP General Mailing List (http
Is it efficient to load objects with data from MySQL for PHP? I'm looking into the
OO-ness of PHP, and I have an idea of making objects, but would like the data loaded
from a SQL source. Is this a good idea?
It looks like you are viewing a dos/windows file on unix. The ^M is
carriage return, which is needed as part of a dos/window end of line
sequence (carriage return, line feed) whereas unix uses just line feed.
Nope. They're UNIX-created and UNIX-modified. Does it matter if I downloaded
them
So which is it that will keep my files from having ^M after PHP is finished fopen(),
fputs(), and fclose() with them? \n, \r, and \n\r all seem to reinsert ^M at the ends
of all my lines.
Check that whole path leading up to the file is accessible (+x) and
readable
(+r) by the webserver.
No. I'm positive. I did the whole chmod 777 * -R at the public_html
directory, and did the proper grouping and ownership in the same way (with
the appropriate commands).
--
PHP General Mailing
Sorry if this is OT, but... heheheh... has anyone taken a look at the PHP site? Check
out the upper-left corner. Who is that? Nice to know the guys at PHP can have a laugh.
Here I go again with the stylesheets. ;) Anyway, if a user has stylesheets turned off,
is a stylesheet file even run? Like, if I have them turned off and I have a
stylesheet, say, SS.php. Will SS.php run or will it be ignored altogether?
Cool. Thanks to all with the help on stylesheet running. I've gotten a few
responses to think about.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Is there any easy way of figuring out if there are 4 or if there are 5 Fridays in a
given month? I have it figured out using a loop, but I was just wondering if there was
a way that date() or strtotime() could do it.
Yeah... the same way you made your web server parse files with a .php
extension. Just repeat the same procedure for a .css extension.
if you have cpanel you can add the extension from there.
Yeah, I need to find out where to add the CSS extension to my list of
parsable files. I tried just
Hi there, can anyone tell me how to fix my code so that on the last day of
the month, my code doesn't repeat the months...
I'm not sure what you mean by this, but I can be a moron on this list
sometimes and the clear answer usually comes to me about 2 seconds after I
hit the send button. Do you
I'm trying to do a count(*) in SQL. Would it be faster to do a or b below?
a: just do a simple query, and use mysql_num_rows() to return the row count; or
b: do the count(*) and use mysql_fetch_row() to return the result.
I guess it would have to do more with SQL response time (is it faster to
Is there anything I should know about is_readable? It seems to find a file unreadable
whether the permissions are 000 or 777.
Is there any way of making PHP parse files with a CSS extension?
Hello, can anyone help me with a php theme selector? I want it like when
the seletect a theme ?theme=green that it will go into a directory and
load green.php or somthing like that please help. Thankyou
I'd store your themes in stylesheets instead.
--
PHP General Mailing List
Can GD library produce animated gif's?
Sorry. Maybe I should read more carefully. I skipped 'animatd' for some
reason? Still, no, GD won't produce animated GIFs.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I'll guess that you're trying to access $frequency outside of the
function, after you've called it, right? If so, read up on variable
scope in the manual.
No, I'm trying to access it inside the function. This is what I have (or an
example, since I don't have it right in front of me right now):
When I have a date, March 31, 2003, and I want to subtract 1 month using strtotime, I
find it will literally subtract a month, so March 31, 2003 minus one month will result
in February 31, 2003, or rather, March 3, 2003. Is there any way of making March 31,
2003 minus one month equal February
Why is it that when I send call this function:
function GetNextDate($whichfriday, $month = , $frequency = 1, $basedate = )
with this line:
GetNextDate(4, 2003-03, 5);
that $frequency ends up ? Whether I set it myself when I call the function, or I
leave it blank and let the function set it
Good question. Are you certain your not misspelling frequency when you
check it or try to look at it? Sorry if that sounds insulting.. just trying
to search for the simplest explaination. :
No, no. Not insulting at all. That's often my problem. But not in this case.
I even went to the
Is there such a thing as an array_search wildcard? Say I want to find anything
beginning with RE and having zero or more characters following it, how would I do that?
$found=array();
foreach($array as $key = $value) {
if(ereg('RE.+',$value)) { // optionaly use eregi for case
insensitiveness
$found[$key]=$value;
}
}
Thanks, Marek. With some minor adjustments, this worked out fine!
--
PHP General Mailing List (http://www.php.net/)
To
I think I might have had this problem a long time ago, but it wasn't resolved, because
here it is again. My carriage returns (\r\n) aren't getting e-mailed.
I have some text:
The quick brown fox\r\n\r\n
jumped over the whateverwhateverwhatever\r\n\r\n
yadda yadda yadda.
I want to create
Is isset() better than $ != ?
Often, I may have a 0 as values. While $ != doesn't recognize 0s (as in, that if
would be false), isset() seems to work. Should I change all my $ != to isset()s, or
are there other factors I should check?
Responding to myself:
Is isset() better than $ != ?
Often, I may have a 0 as values. While $ != doesn't recognize 0s (as in,
that if would be false), isset() seems to work. Should I change all my $ !=
to isset()s, or are there other factors I should check?
Conversely, what about empty(). Is
I'm not sure why, but I can't include a period in my eregi statement:
[A-Za-z0-9_-.]*
For this, I get Warning: ereg() [function.ereg]: REG_ERANGE in
/home/website/public_html/Functions.inc on line 27
The same goes for [A-Za-z0-9_-\.]*
Anyone know why?
try two backslashes to escape php special characters
Tried that with the same result.
I'm not sure why, but I can't include a period in my eregi statement:
[A-Za-z0-9_-.]*
For this, I get Warning: ereg() [function.ereg]: REG_ERANGE in
/home/website/public_html/Functions.inc on line 27
Is it just as quick to do:
if($r == 0) {
} else if($r != 0) {
}
than to do:
if($r == 0) {
} else {
}
The reason I like the former method is because, in a large IF-ELSE block, it's clear
what belongs to what IF and what's going on. But does this make it lag? And, if so, is
it really all that
If you want clarity, why not:
if($r == 0) {
...
} else { // $r != 0
}
Hmm. That's a good idea. Yeah, I was sure the else-if method wasn't faster.
I just wasn't sure if it was slower, or if that really mattered. But your
method seems fine, and I have no idea why I didn't think of that.
--
it to my Yahoo account, but it's not coming
through there yet.
mail([EMAIL PROTECTED], Website Notice, [messagebody], From: Liam [EMAIL
PROTECTED]:[EMAIL PROTECTED]: text/ascii; charset=iso-8859-1\n);
If need be, I can post the message body, but I'm hoping someone can figure it out
without
It may be that the mail receiver expects some content after you put this
in
the header:
Content-Type: text/ascii; charset=iso-8859-1\n
If you're sending plain text, and no special (read: non-western)
characters, i don't think you need that part.
That was the fix. Yer a goldmine.
This line:
INPUT TYPE = FILE NAME = imprintpicture SIZE = 22
when clicking submit, produces nothing. I print_r $_FILES[imprintpicture], I try to
echo $_FILES[imprintpicture][name] or [tmp_name] and nothing comes up. Any
reason?
Is your form enctype set?
That might be it and I think it's it and OH yes that was it. Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I have a function, such as this:
function encryptPassword($password, $salt = $encryptiontechnique) {
}
$encryptiontechnique is defined, obviously outside the function. How is it possible to
make $encryptiontechnique global so that this will work?
That's generally not a good idea because depending on the type of control
empty input fields will not be available in the $_POST array (e.g.
unchecked checkboxes are _not_ sent by the browser).
You should rather have a list of input variables that need to be filled
and
compare $_POST against
I know this is not exactly on topic but I produce all html by php and I
don't want to go out and add myself to an html list (if there is such a
thing).
There must be, but don't worry. Try stylesheets. Even if your Web site isn't
designed with them, I would suggest it. But there is also the
I'm downloading a file from Windows to Linux through PHP. Understandably, there are
^Ms at the end of my lines. Is there a PHP function I can use to delete them?
I know that in a case like this
if((test1) (test2) (test3)) {
...
}
if test1 fails, dear PHP won't bother doing test2 and 3. Am I correct? Is there a
syntax that will make it carry on with test2 and 3 anyway, regardless of how test1
came out?
The more efficient compilers/parsers stop when one test fails, some do
them all. I don't know which php does but surely it is irrelevant? If
test1 fails, because of the and the if statement will not be
executed. I wonder what the reason is for your wanting it to do test2
and test3, maybe I'm
Use a decent text editor that'll save the files in Unix format... even
if you're on a PC.
Yeah, I could use a decent text editor, but not everyone who uses my site
will use it. I need something that can edit them out after download.
--
PHP General Mailing List (http://www.php.net/)
To
but of course no luck. Is there a way I can force a refresh from my
script?
There is an HTML solution, but I can't remember offhand what it is. HTML
would be the only way to go, I'd say, since once the page is in the
browser's hands, PHP can't do anything about it.
--
PHP General Mailing List
Does anyone know a link to find the recent discussion on this list about adding dates
in PHP? I can't seem to find it in the archives, and the simple act of adding one week
to a date seems to be a mindblowing headache using PHP mktime() and date().
http://www.php.net/manual/en/function.strtotime.php
Thank you, Sebastian. I never even took a look at this function before. This
was a complete lifesaver!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
This is the code around line 30.
$local_file = $feed;
$fp = fopen($local_file, r);
Anyone have any ideas? I have looked over the manual and the only thing I
could find similar to this is in the comments. Apache was restarted.
I get the same thing so I'm working through it. But here
Why is it the following code produces nothing?
$responsesubmitted = FALSE;
print($responsesubmitted);
I have an if statement that says if($responsesubmitted), but it doesn't work.
I have users uploading images to a server and need to have those files
resized on upload. I looked under filesystem, but found nothing like that.
Anyone?
Check the GD extension. You'll need that installed, and the images can't be
GIFs (must be JPEGs or TIFs, something like that). Anyway, there
You'll need to either use the gd functions, or my recommendation, get
the imagick module and use it. Both should do an excellent job. iMagick
is in PEAR.
How is PEAR making out? What makes it better than using the GD extension? I
will need to do image manipulation (much like the original
You could probably do this. Set up a $$where variable, which would contain
where . $i, $i being the iterator of your loop.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
in my php script registration1.php, i have written
javascript for form validation i.e. for checking if
the mandatory fields are filled correctly or not.
but on clicking the submit button, i get connected to
the next page without the form getting validated!!
What's wrong with using PHP to
If you want to validate form data before sending it, javascript is the
choise.
Yeah, before sending it. Just wondering what the advantage is in validating
before sending.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
How do you make a command not return a warning... I thought it was the
@ sign, but i think i'm wrong, and everything i've tried hasn't worked,
i want this for a switch command if that matters.
It's the @ sign. Put it right before the command, as in @fopen(). Show us
the line that is giving you
Is there a way to find the minimum and maximum values of an array? min() and max()
don't take arrays.
you can sort it and get the values.
I would, but I need the array in the same order. I can't sort it.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
First of all, thanks all who helped with the min and max functions (that works) and
the dollar sign bit (which also works). Kudos. Couldn't have done it without y'all!
Here's the newest brain teaser: I have cookies disabled (well, I have IE set to the
highest security mode, where it disables
I need to modify a string that contains image links like img
src=http://www.somedomain/directory/graphics/filename.jpg; to
image links like img src=graphics/filename.jpg
Maybe something like with str_replace()?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
How is it I can properly get PHP to represent dollar signs when putting it into HTML?
I know that dollar signs denote the beginning of a variable, like $reference or
$ftpstream or whatever. However, I have a text file that contains (or can contain)
values with $ in them. When I open the file
Escape them with a backslash:
$text = The amount is \$400.-;
All that does is print \$ in my HTML.
What's going on is that it will put, say, RR$T into a file when that's typed
into a textbox or any typable form control. That's properly saved in the
file.
So the file will contain RR$T.
When
Could you show some code to illustrate the unpredictable results that you
get?
Here's what I have in my file:
[EMAIL PROTECTED]@#%:[EMAIL PROTECTED]@[EMAIL PROTECTED]|#:~December, 2003~on~fjskl
It's first exploded() by ~, then those values are produced by print()
statements, like this one:
I'll try the single quotation mark method first, though.
Single quotations didn't seem to work either.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
The problem I ran into is that mySQL will not allow certain punctuation
inside of a record (no comma's). So now I am left trying to figure out how I
can have the user update the paragraph without having it in a db. Can
someone shoot me in the proper direction? Thanks in advance, your help is
What I have discovered is that I can manually type it in the mysql server
with whatever characters I want, but when I try to update it with a sql
file
or via the webpage I created with the comma's it gives me errors. I take
them out of the sql text and webpage and it works fine.
The problem
$Query = UPDATE $TableName SET Intro_Title = '$Intro_Title', Intro =
'$Intro' WHERE ID = '$ID';
But what's being sent to SQL? What's contained in $TableName, $Intro_Title,
etc.? And what data types are all those fields?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
You are correct and it is apostophe's and not comma's that cause the
error. What do I do to get around that?
Escape them by putting a slash in front of them. If you have a line of text
that says 'This is the problem area I don't want to screw up', put 'This is
the problem area I don\'t want to
1) Do the temp files automatically delete, or do I
need to put something in the code to delete them?
They do, and I believe it's until the end of the currently-running PHP
script.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
I am using the folling code to list all of my tables in a database:
however, i would like to show the user how many rows there are in each
table
(where i have put numrows), how could i do this?
This will be costly on process time, but you could just do a SELECT COUNT(*)
on all the tables. If
Can I run a php script in crontab?
Do I echo or print?
Anyone doing it?
This is a serious security hazard. However, what you could do is have a PHP
page set cron settings (such as name of file, location, frequency, and
importance), then have another cron job (running at a decent frequency) do
Can I run a php script in crontab?
Do I echo or print?
Anyone doing it?
Well, why don't I just completely misunderstand the question. Sorry,
everyone.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Maybe I'm off my rocker, but I don't see how this can't work. I'm trying to validate
an ICQ number, and assuming a valid one is between 7 and 9 numbers. My line of code is
this:
if(ereg(^[0-9]{7,9}$, $_REQUEST[icqnumber])) {
print(a-okay!);
} else {
print(error msg);
}
I've submitted
I seem to be having trouble with htmlentities(). Maybe someone has a clue I can
borrow. Here's my function:
function FitForHTML($string) {
$asciitable = get_html_translation_table(HTML_ENTITIES);
$string = htmlentities($string, ENT_COMPAT);
$string =
First off, when executing this command:
$connection = mysql_connect(localhost, root, );
I get this error msg:
Warning: mysql_connect() [function.mysql-connect]: Access denied for user:
'root@localhost' (Using password: NO) in
/home/superpage/public_html/index.php on line 49
I've gone and read
This line of code:
if(!is_readable(Constants.inc)) chmod(Constants.inc, 0644);
Produces this error:
Warning: chmod() [function.chmod]: Operation not permitted in
/home/mastersite/public_html/index.php on line 6
What I'm trying to do is determine if Constants.inc is readable. If not, I
want to
When I run, $r = get_browser(); and take a look at the css value, I get 2. I
would have figured that it could only be 0 (not supported) or 1 (supported).
What are the possible values for get_browser()'s css, and what do those
values mean?
--
PHP General Mailing List (http://www.php.net/)
To
1 - 100 of 317 matches
Mail list logo