 |
 |
Index ‹ php-general
|
- Previous
- 1
- [PHP-DB] mssql connectingDid you already try these steps?
http://us2.php.net/manual/en/function.mssql-connect.php#70918
On 5/23/07, Bryan <email***@***.com> wrote:
>
> I'm trying to connect to mssql 2000 on a windows server 2003 standard
> box using php v5.1.6/apache 2.2.2 fedora core 4 on a separate box, of
> course. Any ideas?
>
> It just gives me the wonderful error: SQL error: [unixODBC][Driver
> Manager]Data source name not found, and no default driver specified, SQL
> state IM002 in SQLConnect in <file>.
>
> I also have Plesk 8.1 on the linux box so if I need to recompile php,
> would it break anything? I've installed freetds as well but haven't
> recompiled php questioning the above.
>
> Thanks for any and all help...
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
- 1
- upload scripthi,
I was wondering if anyonehad a script to upload files.
Thank You
- 4
- About MySQL TablesI have two tables that share product codes to relate data.
One table is called IMAGE, and another one is called the PRODUCT.
There are more than one image for every product, for example product
code 1122 will have 3 images and 4938 will have 5 images within the
IMAGE table. Since all my product information is stored in PRODUCT table
except for the image file names (e.g. 1122_1.jpg, 1122_2.jpg or
4938_1.gif), I have to build the following query: SELECT * FROM PRODUCT,
IMAGE WHERE PRODUCT.productcode = IMAGE.productcode. However, this
causes a little problem. When I print out all the product information
with its images, more than one copy of a product is printed out (because
of multiple images for each product). I'm still looking for a way to
build a query string so that I could have only one image displayed per
product (so that a user can click on the product to view more images).
Do you know how this problem can be best approached?
- 5
- No https, ftps and sslI just compiled and installed PHP 5.2.1 from source on an Ubuntu Edgy Eft
server.
I was under the impression that including these switches in the
configuration:
'--with-curl=/usr/src/php-5.2.1/ext/curl'
'--with-openSSL'
would incorporate https, ftps and ssl in my build.
phpinfo() includes this
for Registered PHP Streams:
zip, php, file, data, http, ftp, compress.bzip2, compress.zlib
for cURL:
cURL support
enabled cURL Information
libcurl/7.15.4 OpenSSL/0.9.8b zlib/1.2.3
So what have I missed?
I do not need these immediately, but a credit trading system is somewhere in
future so they will be needed.
Regards - Miles Thompson
I just compiled and installed PHP 5.2.1 from source on an Ubuntu Edgy Eft server.<br><br>I was under the impression that including these switches in the configuration:<br> '--with-curl=/usr/src/php-5.2.1/ext/curl'
<br> '--with-openSSL'<br>would incorporate https, ftps and ssl in my build.<br><br>phpinfo() includes this <br><br>for Registered PHP Streams: <br><div style="margin-left: 40px;">zip, php, file, data, http, ftp,
compress.bzip2, compress.zlib<br></div><br>for cURL:<br><br><table border="0" cellpadding="3" width="600"><tbody><tr><td class="e"><div style="margin-left: 40px;"><font size="2">cURL support </font></div></td><td class="v">
<font size="2">enabled </font></td></tr>
<tr><td class="e"><div style="margin-left: 40px;"><font size="2">cURL Information </font></div></td><td class="v"><font size="2">libcurl/7.15.4 OpenSSL/0.9.8b zlib/1.2.3</font></td></tr></tbody></table><br>So what have I missed?
<br><br>I do not need these immediately, but a credit trading system is somewhere in future so they will be needed.<br><br>Regards - Miles Thompson<br><br>
- 8
- [PHP-DB] Page refresh and database updationYou can redirect the page to the result page after the data is saved, using header("Location: successpage.php"). I've used this on several sites. It's a little extra work but does prevent the reposting of data.
Another option is to use AJAX to send the data to the webserver and then have the javascript open the result page after the update is complete. I do this on several of my webpages and it works great.
>Tamkhane, Pravin wrote:
>> Hi All,
>> I am a PHP newbie. I am using HTTP POST request to send some data to
>> Apache and then using MySql to store that information. Once information
>> is stored in MySql DB successfully, I display a result page. But the
>> problem I am facing is that, if I refresh the result page displayed
>> after database updation, the information is stored again in database
>> which I don't want to. Please guide me on how I can avoid duplication of
>> information in database on refreshing the page. Thanks in advance!
>>
>> Regards,
>> Pravin
>You probly want to use a seperate script to build the results, or even a
>PEAR template mechanism.
>
>/cs
>
>--
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
- 10
- Clearing session variable valuesThe Manual is not 100% clear to me about session variables. This seems to
work, but I'm not experience enough to know if there is some hidden trap or
vulnerability. This is for suPHP, Version 5.2.4. Register-globals off.
I have a made-from-scratch CMS for a local nonprofit. Admins can write and
edit articles into a database. Some of the variable passing in these pages
is done in session variables.
In editing mode, most fields fill automatically from the database info
unless a session variable is set, in which case it fills the session
variable data instead. So if a user edits an item then starts to edit
another item, I don't want the fields filling with session data from the
first edit!
My solution is a form button that is intended to clear all session data
except login data, then send the user back to the page. Here's the page I
came up with:
[CODE]
<?php
require_once('./session.inc.php'); //session module, tests for login
security
if($gtg2!='xp8tbYYmx')header("Location:http://mysite.com/members/login.php");
// another security test for admin-level access, using a session
variable from the first require()
if((isset($_POST['Submit']))&&($_POST['submitted']=='CLEARSESS')) {
// unset all session variables except the six login/sercurity
variable
foreach($_SESSION as $k=>$v) {
if ($k=='id') continue; //PHPSESSID
if ($k=='username') continue;
if ($k=='password') continue;
if ($k=='status') continue; #low level security for subdirectory
if ($k=='gtg1') continue; #medium level security for subdirectory
functionality
if ($k=='gtg2') continue; #high level security for admin functionality
unset($_SESSION["$k"]);
}
}
// return user to the page where he started, using a unique hidden
POST['thispage'] value
if($_POST['thispage']=='CLEARSESS1') {
header("Location:http://mysite.com/admin/edit_stuff.php");
} elseif ($_POST['thispage']=='CLEARSESS2') {
header("Location:http://mysite.com/admin/write_stuff.php");
} else {
header("Location:http://mysite.com/admin/index.php");
}
?>
I'd be greatful for any help/comments.
--
Mason Barge
- 10
- How do I destroy my sessions?I have 2 .php pages, one called emailForm.php and the other calle
email.php.
emailForm.php has the actual form to fill out to send an email to th
owner. If not all fields are filled out when you hit the Send button
the Send button calls email.php, checks to see what fields haven't bee
filled out, and sends the error messages back to emailForm.php, fill
in the fields that were filled in prior to hitting the send button
with the error message in red above the fields that weren't filled in.
Code excerpt from emailForm.php:
<?php
session_start();
require "header.php";
function fieldError($fieldName, $errors)
{
if (isset($errors[$fieldName]))
echo "<fon
color=RED>$errors[$fieldName]</font><br>";
}
?>
Further down:
<form action="/*email.php*" method="post">
<td nowrap align=right><font color="black" face="verdana
size="-1">First Name: </td>
<td colspan=2 align=left><? echo fieldError("Fname",$errors); ?>
<input type="text" name="Fname" value="<? ech
$formVars["Fname"]; ?>" size=40>
</td>
Code exerpt from email.php:
<?php
include "db.php";
session_start();
if (!session_is_registered("errors"))
session_register("errors");
$errors = array();
if (!session_is_registered("formVars"))
session_register("formVars");
foreach($HTTP_POST_VARS as $varname => $value)
$formVars[$varname] = $value;
if (empty($formVars["Fname"]))
$errors["Fname"] = "The first name field cannot b
blank.";
if (empty($formVars["Lname"]))
$errors["Lname"] = "The last name field cannot b
blank.";
if (empty($formVars["userEmail"]))
$errors["userEmail"] = "The Email field cannot b
blank.";
if (empty($formVars["subject"]))
$errors["subject"] = "The subject field cannot b
blank.";
if (empty($formVars["zip"]))
$errors["zip"] = "The zip code field cannot b
blank.";
if (empty($formVars["body"]))
$errors["body"] = "Please type in a message.";
if (count($errors))
{
header("Location: *emailForm.php*");
exit;
}
session_destroy();
So my question is how do I destroy the session on both pages once th
email is sent successfully? If anyone needs more code to see, I ca
provide it. Thanks
- 12
- sprintf ?I'd like to format 2114000 (Stored as a double)
as R 2,114,000.00
Do I have to append the R in the front, and then use sprintf somehow to
format the number, or is there a better way to do this.
- 12
- 12
- type hinting with optional argumentsRob Long wrote:
> Hey,
>
> I've just noticed a somewhat annoying feature with PHP5 type hinting.
>
> You cannot hint types on optional arguments like this:
>
> class MyClass
> {
> function someFunc(Type1 $arg1, Type2 $arg2 = new Type2()) { }
>
> //or
> function someFunc(Type1 $arg1, Type2 $arg2 = null) { }
>
> //or
> function someFunc(Type1 $arg1, Type2 $arg2 = Type2::getInstance()) { }
> }
>
> In fact, there doesn't seem to be any way to do this. I guess you
> could do something with global variables, but no thanks....
>
> Any ideas??
IMO, it's only logical. Optional arguments need to have a literal value as
the default, and in your examples above only null is a literal value; others
are expressions, which are not allowed in optional argumetn definitions.
Remember that PHP is dynamically typed language; there is nothing preventing
you from:
function Function($obj = null) {}
$object = new Class();
Function($object);
Berislav
- 12
- Function tablesI'd like to implement one of these (a function table).
First I thought that execution through variable functions
($foo='bar', $foo() executes the function 'bar') would work work, but
this seems to get upset when my function is actually a method of a
class.
Then I hoped that call_user_func(_array) would do the trick, but this
seems to get upset when the method uses "this", which is something of
a serious limitation it seems to me.
Anyone know ways around either or both of these apparent (to me)
problems?
Regards
Mark
- 13
- HOT !!! CHINA DISCOUNT CHEAP D&G CHANELSUNGLASSES ETCBrand Sunglasses Wholesale:
Discount, Prada Sunglasses
Discount, D&G Sunglasses
Discount, Fendi Sunglasses
Discount, Burberry Sunglasses
Discount, Chanel Sunglasses
Discount, LV Sunglasses
Discount, Dior Sunglasses
Discount, (G U C C I ) Sunglasses
Discount, Armani Sunglasses
Discount, Versace Sunglasses
Discount, A&F Sunglasses
Discount, LV Sunglasses
- 13
- Smarty and pager pluginHello,
can someone show use example use smarty pager plugin? {pager
rowcount=$LISTDATA.rowcount limit=$LISTDATA.limit txt_first=$L_MORE
class_num="fl" class_numon="fl" class_text="fl"}
I'm fighing with it for 5 hours, and still don't have any results :(
Slawek,Poland
- 16
- perl extension for PHP - stuck?I installed a perl extension for PHP to use some perl inside my php
primarily because I have perl working with oracle and not php and
oracle. So I want to use my old perl scripts, and use the
functionality of php. The extension uses the '$perl->eval' function.
i am kind of stuck with the syntax or how to put the php variable into
the perl script. I have a form where the user puts in a grid
reference. Then a php script that gets the entered values and puts
them into a sql. Except all that bit is in Perl. How can this be done?
<?php
//php request
$easting = $_REQUEST['easting'];
$northing= $_REQUEST['northing'];
//perl code
$perl = new Perl();
$perl->eval('use CGI');
$perl->eval('use DBI');
// declare variables
$perl->eval('my ($dbh, $sth, $cgi, $the_value, $easting,$northing)');
//instance of the cgi module
$perl->eval('$cgi=new CGI');
//connects to the database
$perl->eval('$dbh = DBI-
>connect("DBI:Oracle:server_name","username","password")');
$perl->eval('$sth= $dbh->prepare("Select value from tblData
where Easting=?
and Northing=?")');
// in perl this would take these 2 variables and put them in the '?'
of the sql bit
$perl->eval('$sth->bind_param(1, $easting)');
$perl->eval('$sth->bind_param(2, $northing)');
//execute etc
$perl->eval('$sth->execute');
// bind the query result to $the_value variable
$perl->eval('$sth->bind_columns(\$the_value)');
$perl->eval('($sth->fetch)');
//print result
$perl->eval('print "$the_value"');
?>
thanks
- 16
- RE:PHP on a home PC?Try the following Webserver
YellowTip WebServer 2.0
it contains Apache 2, Web Server 2.0 will include the latest stable versions of PHP, MySQL, Zend Optimizer and phpMyAdmin.
good louck
|
| Author |
Message |
sf

|
Posted: 2008-3-13 2:49:14 |
Top |
php-general, PHP CLI neat errors!
So, I use a Mac to develop with. I used to host Zend Core on my box,
until I switched to the MAMP PRO framework.
Unfortunately somewhere in between, this lovely issue started occuring
with my CLI binary of PHP:
foo:~ sf$ php -l
dyld: NSLinkModule() error
dyld: Symbol not found: _zend_extensions
Referenced from: /usr/local/Zend/Core/lib/zend/ZendExtensionManager.so
Expected in: flat namespace
Trace/BPT trap
I could recompile PHP because if I'm reading this properly, some
dynamically shared libraries aren't loading. Before I do that though,
was curious if anyone ever faced the same dilemma before.
Cheers!
/sf
|
| |
|
| |
 |
petersprc

|
Posted: 2008-3-13 3:01:00 |
Top |
php-general >> PHP CLI neat errors!
Hi,
Maybe try disabling xdebug or Zend Optimizer if you have those
extensions enabled?
Regards,
John Peters
On Mar 12, 2:49 pm, email***@***.com ("Steve Finkelstein") wrote:
> So, I use a Mac to develop with. I used to host Zend Core on my box,
> until I switched to the MAMP PRO framework.
>
> Unfortunately somewhere in between, this lovely issue started occuring
> with my CLI binary of PHP:
>
> foo:~ sf$ php -l
> dyld: NSLinkModule() error
> dyld: Symbol not found: _zend_extensions
> Referenced from: /usr/local/Zend/Core/lib/zend/ZendExtensionManager.so
> Expected in: flat namespace
>
> Trace/BPT trap
>
> I could recompile PHP because if I'm reading this properly, some
> dynamically shared libraries aren't loading. Before I do that though,
> was curious if anyone ever faced the same dilemma before.
>
> Cheers!
>
> /sf
|
| |
|
| |
 |
| |
 |
Index ‹ php-general |
- Next
- 1
- smarty for ajaxIs there any framework or plugin for smarty which can be used with Ajax?
M
- 2
- $$$$$$$$make money online$$$$$$$$50,000 for only $5 in two months? You gotta be crazy! How can you
make $50,000 for only $5? Well, that's what I was wondering too until
I came across this letter.
First of all, IT'S PERFECTLY LEGAL! (Call 1-800-725-2161) if you have
any questions about the following opportunity to make $50,000.00 and
that probably WITHIN LESS THAN TWO MONTHS!
Well, here it goes: A little while back, I was browsing these
newsgroups, just like you are now, and came across an article similar
to this that said you could make thousands of dollars within weeks
with
only an initial investment of $5.00! So I thought, "Yeah, right, this
must be a joke," but like most of us I was curious, so I kept reading.
Anyway, it said that you send $1.00 to each of the 5 names and
address
stated in the article. You then place your own name and address in
the
bottom of the list at #5, and post the article in at least 200
newsgroups. (There are thousands) No catch, that was it.
As I mentioned before, like most of us I was a little skeptical and a
little worried about the legal aspects of it all. So I checked it out
with the U.S. Post Office (1-800-725-2161) and they confirmed that it
is indeed legal!
What are the basics of each system and why are they legal? Each
system
follows the same basic steps which define a business by offering
others
the ability to get involved using the system you advertise in
newsgroups
on the Internet and accepting a small fee for the requests of those
who
respond to be added to your mailing list. Yes, you will be in the
business of creating your own mailing list. Their requests to be
added
to your mailing list which is sent with a $1 fee for your service
define
a legal business opportunity under U.S. Postal and Lottery Laws --- a
legal business opportunity for you which is covered in title 18,
sections 1302 and 1342 of the U.S. Postal and Lottery Laws.
Now, what one does, or does not do, with the mailing list being
constructed is a personal decision. One could decide to do nothing
with this list, to use it as a tool in building another business or
expanding an existing business. This decision is up to the creator of
the mailing list -- this decision is up to you.
Make sure you print a copy of this article NOW, so you can get the
information off of it as you need it. The process is very simple and
consists of 3 easy steps:
STEP 1: Get 5 separate pieces of paper and write the following on
each
piece of paper "PLEASE PUT ME ON YOUR MAILING LIST." Now get 5 $1.00
bills and place ONE inside EACH of the 5 pieces of paper so the bill
will not be seen through the envelope to prevent thievery. Next,
place
one paper in each of the 5 envelopes and seal them. You should now
have
5 sealed envelopes, each with a piece of paper stating the above
phrase
and a $1.00 bill. What you are doing is creating a service by this.
THIS IS PERFECTLY LEGAL! Mail the 5 envelopes to the following
addresses:
#1 G. Duchacek
1825 Lee Janzen Drive,
Kissimmee Bay,
Kissimmee, FL. 347347
#2 T. Roberts
4810 Meadow Lark Lane
Paso Robles, CA 93446-4220
#3 D. Wild
32 Ridgeview Circle
Milan, Oh 44846
#4 Smith
935 E. South
Independence, MO 64050
#5 t. rojas
42-40 212st apt 3a
bayside, ny 11361
STEP 2: Now take the #1 name off the list that you see above, move
the
other names up (2 becomes 1, 3 becomes 2, etc.....) and add YOUR Name
as number 5 on the list.
STEP 3: Change anything you need to, but try to keep this article as
close to original as possible. Now, post your amended article to at
least 200 newsgroups. (There are over 35,000 groups with more being
added all the time) All you need is 200, but remember, the more you
post, the more money you make! Don't know HOW to post in the
newsgroups?
Well do exactly the following:
FOR NETSCAPE USERS:
1) Click on any newsgroup, like normal. Then click on "To News",
which
is in the top left corner of the newsgroup page. This will bring up a
message box.
2) Fill in the SUBJECT with a flashy title, like the one I used,
something to catch the eye!!!
3) Now go to the message part of the box and retype this letter
exactly
as it is here, with exception of your few changes. (remember to add
your
name to number 5 and move the rest up)
4) When your done typing in the WHOLE letter, click on 'FILE' above
the
send button. Then, 'SAVE AS..' DO NOT SEND YOUR ARTICLE UNTIL YOU
SAVE
IT. (so you don't have to type this 200 times :-)
5) Now that you have saved the letter, go ahead and send your first
copy! (click the 'SEND' button in the top left corner)
6) This is where you post all 200! OK, go to ANY newsgroup article and
click the 'TO NEWS' button again. Type in your flashy subject in the
'SUBJECT BOX', then go to the message and place your cursor here. Now
click on 'ATTACHMENT' which is right below the 'SUBJECT BOX'. Click
on
attach file then find your letter wherever you saved it. Click once
on
your file then click 'OPEN' then click 'OK'. If you did this right,
you
should see your filename in the 'ATTACHMENT BOX' and it will be
shaded.
NOW POST AWAY!
FOR INTERNET EXPLORER:
It's just as easy, holding down the left mouse button, highlight this
entire article, then press the 'CTRL' key and 'C' key at the same
time
to copy this article. Then print the article for your records to have
the names of those you will be sending $1.00 to.
Go to the newsgroups and press 'POST AN ARTICLE' type in your flashy
subject and click the large window below. Press 'CTRL' and 'V' and the
article will appear in the message window. **BE SURE TO MAKE YOUR
ADDRESS CHANGES TO THE 5 NAMES.** Now re-highlight the article and
re-copy it so you have the changes.... then all you have to do for
each
newsgroup is 'CTRL' and 'V' and press 'POST'. It's that easy!! THAT'S
IT! All you have to do is jump to different newsgroups and post away,
after you get the hang of it, it will take about 30 seconds for each
newsgroup!
**REMEMBER, THE MORE NEWSGROUPS YOU POST IN, THE MORE MONEY YOU WILL
MAKE!! BUT YOU HAVE TO POST A MINIMUM OF 200**
**If these instructions are too complex to follow, try Forte's "Free
Agent." It is freeware for noncommercial use. To download it, simply
use a search utility and type "Forte Free Agent". You should be able
to
find it.**
That's it! You will begin receiving money from around the world within
days! You may eventually want to rent a P.O. Box due to the large
amount
of mail you receive. If you wish to stay anonymous, you can invent a
name to use, as long as the postman will deliver it. **JUST MAKE SURE
ALL THE ADDRESSES ARE CORRECT.**
Now the WHY part: This entire principle works because it is in a
format
of an upside down tree with thousands of branches. Everyone below you
will see to it that the tree continues because they want to get
money.
Those below THEM will continue because THEY want to get the cash
etc.
Out of 200 postings, say I receive only 5 replies (a very low
example).
So then I made $5.00 with my name at #5 on the letter. Now, each of
the
5 persons who just sent me $1.00 make the MINIMUM 200 postings, each
ith my name at #4 and only 5 persons respond to each of the original
5,
that is another $25.00 for me, now those 25 each make 200 MINIMUM
posts
with my name at #3 and only 5 replies each, I will bring in an
additional $125.00! Now, those 125 persons turn around and post the
MINIMUM 200 with my name at #2 and only receive 5 replies each, I will
make an additional $626.00! OK, now here is the fun part, each of
those
625 persons post a MINIMUM of 200 letters with my name at #1 and they
each only receive 5 replies, that just made me $3,125.00!!! With a
original investment of only $5.00! AMAZING! And as I said 5 responses
is actually VERY LOW! Average is probable 20 to 30! So lets put those
figures at just 15 responses per person. Here is what you will make:
at #5 $15.00
at #4 $225.00
at #3 $3,375.00
at #2 $50,625.00
at #1 $759,375.00
Your name is no longer on the list, you just take the latest posting
in
the newsgroups, and send out another $5.00 to names on the list,
putting
your name at number 5 and start posting again. The thing to remember
is
that thousands of people all over the world are joining the Internet
and
reading these articles everyday, JUST LIKE YOU are now!! And this will
go on and on and on and on.... get the picture? Well, there's over
5,000,000,000 people on the world and most of them will eventually end
up being hooked into the Internet. So there are virtually unlimited
resources. Of course this will work the best at the very beginning so
the faster you post, the better for YOU!
So can you afford $5.00 and see if it really works?? I think so!
People
have said, "what if the plan is played out and no one sends you the
money? So what! What are the chances of that happening when there are
tons of new honest users and new honest people who are joining the
Internet and newsgroups everyday and are willing to give it a try?
Estimates are at 20,000 to 50,000 new users, every day, with thousands
of those joining the actual Internet. Remember, play FAIRLY and
HONESTLY and this will work. You just have to be honest. Make sure
you
print this article out RIGHT NOW, also. Try to keep a list of everyone
that sends you money and always keep an eye on the newsgroups to make
sure everyone is playing fairly.
Remember, HONESTY IS THE BEST POLICY. You don't need to cheat the
basic
idea to make the money!! GOOD LUCK to all and please play fairly and
reap the huge rewards from this, which is tons of extra CASH. **By the
way, if you try to deceive people by posting the messages with your
name
in the list and not sending the money to the rest of the people
already
on the list, you will NOT get as much. Someone I talked to knew
someone
who did that and he only made about $150.00, and that's after seven or
eight weeks! Then he sent the 5 $1.00 bills, people added him to their
lists, and in 4-5 weeks he had over $10k. This is the fairest and most
honest way I have ever seen to share the wealth of the world without
costing anything but our time!!! You also may want to buy mailing and
e-mail lists for future dollars. Please remember to declare your
extra
income. Thanks once again.
- 3
- M'I-5,Perse cution ' harassm ent at wo rk-=-=-=-=-=-=-=-=-=-=-=-=
-= harassment at. work -=
-=-=-=-=-=-=-=-=-=-=-=-=
Once I stopped watching television and listening to. the radio at the end of
1990, "they" had to find other ways of committing. abuses. So they took what
must be for them a tried and tested route; they get at you by. subversion of
those around you. Since they wouldn't be able to do that. with my family or
friends, that meant getting at people in the workplace to. be their
mouthpieces and do. their dirty work for them.
They supplied my employers in Oxford with details from what was going. on in
my private life, and what I and other people. had said at my home and
accommodation in Oxford. So people at work repeated verbatim words. which
had been said in my home, and repeated what I'd been. doing recently. Often
the most. trivial things, the ones from your domestic life, are the ones
which hurt most. One manager in particular at. Oxford continuously abused me
for ten months with verbal sexual abuse, swearing, and threats to. terminate
my employment. After ten months. I was forced to seek psychiatric help and
start taking medication, and was away. from work for two months. I spoke
later with a. solicitor about what had happened at that company; he advised
it was only possible to. take action if you had left the company as a result
of harassment, and such an action would have to be started very soon. after
leaving.
Over. a year later the same manager picked on another new worker, with even
more serious results;. that employee tried to commit suicide with an
overdose as a result of the ill-treatment, and was forced. to leave his job.
But he didn't take action. against the company, either. Abuse at work is
comparable to. that elsewhere in that tangible evidence is difficult to
produce,. and the abusers will always have their denials ready when
challenged. And even if a court accepts what you say happened, it. still
remains to prove that abuse causes the. type of breakdown I had at the end
of 1992. In a recent case before a. British court, a former member of the
Army brought a case against others who. had maltreated him ten years
previously. Although the. court accepted that abuse had occurred, it did not
agree that depressive illness necessarily followed, and denied. justice to
the. plaintiff.
4315
- 4
- Is there any special way for variable++?Say I have a table in a MySQL server
ID USERNAME COUNT
0 JOHN 2
1 JANE 3
2 HOMER 3
3 MOE 2
If I want to increase Homer's count by 1,
The plain way would be;
1)$TEMP=SELECT COUNT WHERE ID=2
2)$TEMP++
2)UPDATE .. SET COUNT=$temp...
I guess if there is any special way to increase the int value by one?
For increasing 1 is so commonly used (that's why c,c++,java,C# has the
operator ++).
- 5
- Checking for marked checkboxWhen cycling through a MySQL database I made a table the first column
of the table I made a checkbox so that if a user checks that checkbox
they can modify the information in that row. I don't know if this is
the best way to present a user information so that they can edit it.
Anyway, these checkboxes are labelled user[0], user[1] and so on. I was
wondering if there would be an easy way to check to see if any or all
of these are checked without manually doing if...else statements for
each one.
Thanks
- 6
- php to generate java-scriptAnyone have a good method of grabbing the current page and reading data
from it?
For example:
<?PHP
// find all form fields for current page
function FindFormFields( $page ) {
if( empty( $page ) ) {
$data = -1;
} else {
if( ( $fh = @fopen( $page, "r" ) ) === FALSE ) {
$data = -1;
} else {
while( !feof( $fh ) ) {
$line = fgets( $fh, 512 );
if( eregi( "<input type=\"", $line ) ) {
$data[] = $line;
}
}
fclose( $fh );
}
}
return $data;
}
echo FindFormFields( "http://php.net" );
?>
The above code would output the following:
Array
(
[0] => <input type="text" name="pattern" value="" size="30"
accesskey="s" />
[1] => <input type="image"
)
Now for the problem I am having and a description of what I am trying to
accomplish:
I want to dynamically generate a form and in doing so I would like to
dynamically generate the following javascript features for said page
- javascript form validation
- javascript form field focus
The problem is if I call the current page that is being generated such as
<?PHP
echo FindFormFields( "http://" . $_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI'] );
?>
Not only does it take a helluva long time to load the page but it also
creates a nested array with duplicate values.
My best guess is that the order in which the page is being generated has
something to do with the lag as well as the nested array with duplicate
values.
Could anyone help me or point me in a better direction for performing
these actions?
Thanks in advance,
Jas
- 7
- [PHP] Where can I get the Printer extension?Chuck Anderson wrote:
> It thought it would be bundled with my Windows version pf Php 4.4.1, but
> it is not.
>
> I've searched for it and can't find it at php.net.
You didn't search very hard.
On this page:
http://php.net/printer
Read the bit under "Installation".
"This PECL extension is not bundled with PHP."
and
"You may obtain this unbundled PECL extension from the various PECL
snaps pages (select the appropriate repository for your version of PHP):
PECL for PHP 4.3.x, PECL for PHP 5.0.x or PECL Unstable."
--
Postgresql & php tutorials
http://www.designmagick.com/
- 8
- Help with Flat File Database Image GalleryI don't have a database available, so i'm writing an Image Gallery with
a flat file database.
I have an Add Page:
Uploads Image file, and saves $filename and $caption to text file:
captions.txt
Captions.txt is in format:
photofilename.jpg|caption to do with photo here.
I can easily read out each individual part from the captions.txt file to
display the photo and caption on a display page. I also have a delete
file that unlinks the photo, using the info in the captions.txt file,
but i can't figure out how to remove the entire line from the database
file based on the filename...??? Basically I want to click on an image
like this:
<a href=delete.php?filename=phototodelete.jpg> and have the delete.php
file unlink the picture, and then erase the line in the text file, that
begins with the filename (phototodelete.jpg).
I guess i need to search through the data file and when i match the
filename, erase the line... I'd appreciate any help with that!
Cheers
Matt
- 9
- what 's wrong of the syntax<html>
<?
$code=0001;
$name="hello";
<a herf="../"+$code+"/profile.htm" title=$name target="_top">$name</a>
?>
</html>
i suppose the output is a hyper link , but why i can do that?
thanks!
- 10
- [PHP] I need an opion!!! Thanks!Sebastian Dieser wrote:
> Hi, we have been using the following codes on our site for a year and I wanted to know if these codes are just spaghetti or its actual usable code. I know it can be bettered a lot I just need opinions if the codes can be used a while more until we reprogram everything as a complete CMS system.
>
> Thanks a lot! my superiors want to know because there is another coder that says these codes are just spaghetti.
>
> There is more codes but i am able to access the database fine and everything else. Of course the codes can be bettered but i dont believe its just spaghetti!!!!! I used these codes because there was no need to reinvent the wheel. I apreciate your help!
I hope you have indenting in your code and it's just the email that came
through badly.
I wouldn't say it's spaghetti code but it could do with a clean-up.
--------
if ($loginConnector->getNumRows($getUser)> 0){
// Login OK, store session details
// Log in
$_SESSION["user"] = $user;
$_SESSION["pass"] = $this->userdata['pass'];
$_SESSION["thegroup"] = $this->userdata['thegroup'];
if ($goodRedirect) {
header("Location: ".$goodRedirect."?".strip_tags(session_id())) ;
}
return true;
}else{
--------
If you're returning out of the function there why do you need an else?
PHP will automatically skip that block if it's not going to process that
code path.
--------
// If user is already logged in then check credentials
if ($_SESSION['user'] && $_SESSION['pass']){
--------
...
reverse that:
if (!isset($_SESSION['user']) || !isset($_SESSION['pass'])) {
return false;
}
You remove a huge if block which isn't needed.
--------
query('SELECT * FROM vendors WHERE ID = '.$HTTP_GET_VARS['id']);
--------
Go to this website and read everything you can find:
http://phpsec.org/projects/guide/
You have sql injection here that needs attention (and if it's here I'm
sure there could be other spots too).
Also HTTP_GET_VARS is old, change it to the newer $_GET['id'] syntax.
--
Postgresql & php tutorials
http://www.designmagick.com/
- 11
- security compromisedHi newsgroup,
it appears someone has broken into my site. This morning I found about 20
files (each called index.htm) suddenly featured this line:
<IFRAME SRC="url-of-bad-site" WIDTH=1 HEIGHT=1></IFRAME>
and their last modified date was set to today between midnight and 1 GMT. In
some files, this line was placed directly after the body opening tag, in
others it was just before </body>. In one file where the whole document is
written in javascript, they had even escaped their quotes!
The malicious url is www.b00gle.com/fa/?d=get
I have no access to the raw server logs and my own log script shows no
strange hits around that time.
How have they done this? And what can I do about it? I ask here because the
site uses PHP a lot but I guess there are more appropriate places to ask.
Thanks
Ivo
- 12
- Issue running PHP 4.4.7 as an Apache module on Windows XPWhen trying to upgrade PHP to version 4.4.7, attempting to start Apache
gives me the following error: "The requested operation has failed!"
The Apache configuration is the same, and as far as I can tell, all the
files are in the right places, and linked properly (php4apache2.dll and
php.ini in C:/PHP4/).
When I copied the php4apache.dll file from PHP 4.4.6 into C:/PHP4 (which
I'm sure isn't a good solution), it worked.
The checksum for the zip file was correct, and I'm running Apache 2.0.59.
- 13
- Flash+PHP photo album: which one??Hi there guys!!
I'm looking for a Flash photo album to put my pics online.
That album should be like the great http://www.imagevuex.com/imagevue
which has a PHP admin script that allows to upload pictures and
automatically create thumbs and pages.
Unfortunately, imagevue is quite an hassle if you have to upload high
resolution pictures (i.e. 8megapixel) because it doesn't resize the
original images, instead you have to upload them at 640x480.
Do you know of any good flash album with PHP script?
Thanks in advance!!
Enrico
- 14
- \n \t don't work!!!Guys,
These codes are copied from the manual:
*****************************************************
echo ("this is the simplest, an SGML processing instruction\n");
echo "This spans
multiple lines. The newlines will be
output as well";
echo "This spans\nmultiple lines. The newlines will be\noutput as well.";
******************************************************
None of them works. I mean there're not any new lines generated in my
browser and I have to use the echo"<br>" to print a new line. But why
doesn't the \n work? BTW, the \t doesn't work either.
(WindowsXP Pro + PHP Version 4.1.1)
Please advise.
cheers,
feng
- 15
- [PHP-DB] REMOVE MEgo to news.php.net and subscribe your self.
On 9 Oct 2003 at 15:47, Muzzamil wrote:
>
> Plzzzz remove me from this mailing list
> Thanks
> email***@***.com
>
>
> > php-db Digest 8 Oct 2003 19:41:35 -0000 Issue 2071
> >
> > Topics (messages 30898 through 30907):
> >
> > Re: Is it possible to access MySQL table on server A from server B?
> > 30898 by: ramki
> > 30900 by: Cesar Schneider
> >
> > My SQL update one table, using reference from another...
> > 30899 by: Tristan.Pretty.risk.sungard.com
> >
> > Re: support to palm db
> > 30901 by: Cesar Schneider
> >
> > mysql_error() returning nothing
> > 30902 by: Ben Edwards
> > 30904 by: Ben Edwards
> >
> > PHP APACHE Database
> > 30903 by: Paul Ciba
> >
> > Problem with uploadscript
> > 30905 by: Ruprecht Helms
> > 30906 by: George Patterson
> >
> > Php433 running on RedHat73 with support to OCI8
> > 30907 by: Adriano Rocha
> >
> > Administrivia:
> >
> > To subscribe to the digest, e-mail:
> > email***@***.com
> >
> > To unsubscribe from the digest, e-mail:
> > email***@***.com
> >
> > To post to the list, e-mail:
> > email***@***.com
> >
> >
> > ----------------------------------------------------------------------
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
|
|
|