 |
 |
Index ‹ php-general
|
- Previous
- 2
- [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
>
- 2
- 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
- 2
- national characters not printedHello,
I have configured MySQL and PHP5. I have created 'books' table in test
database with utf-8 set for database and table. I have inserted a row with
non-latin (Polish) national characters. I also have written simple PHP5
script reading 'books' table:
<?php
header('Content-Type: text/html; charset=utf-8');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="pl">
<head>
<title>Test page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Language" content="pl-PL">
<meta name="description" content="Test page">
<meta name="language" content="polish">
<meta name="author" content="Robert Magdziarz">
</head>
<body>
<?php
$conn = mysql_connect('localhost', 'root', 'mysql');
if (mysqli_connect_errno())
{
echo 'Error: cannot connect to MySQL.';
exit;
}
mysql_select_db('test');
$query = "select title,author,isbn,price from books where price is not
null";
$result = mysql_query($query);
while ($row = mysql_fetch_row($result))
{
echo '<p>';
echo 'Title: "<strong>',
stripslashes($row[0]), '</strong>"<br>';
echo 'Author: ', stripslashes($row[1]), '<br>';
echo 'ISBN: ', stripslashes($row[2]), '<br>';
echo 'Price: ', stripslashes($row[3]);
echo '</p>';
}
mysql_free_result($result);
mysql_close($conn);
?>
</body>
</html>
The problem is that (in browser) instead of Polish national characters I see
question marks! In MySQL Query Browser I can see Polish characters
correctly. Generally my PHP5 in Fedora Linux works fine.
Please help.
/RAM/
- 3
- [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
>
>
- 4
- [PHP] how to get page count when uploading files>I really need help and after going through the help page, I don't know where
>I can post my question.
>
>
>
>When I upload a file (word or pdf), how can I know the page counts of that
>file immediately?
>
>
>
>Thank you, Jian
There's no function in the PDF library to READ the file.
And about Word documents (.doc): Word calculates the amount of pages at 'parsetime'. Word documents are just RTF files, and they
don't describe the amount of pages in the files.
So it's really tricky to make a script that counts the pages in Word documents, as you would have to make an RTF parser. :/
- 4
- 4
- $250 reward for solving Flash/PHP problemSeriously. The first person to provide information that leads to the
arrest or apprehension of this problem will promptly be mailed a $250
gift card to the store of your choice (I don't think we can swing cash
or PayPal for accounting reasons, sorry - this is almost as good,
though, isn't it?)
We are having a heck of a time nailing this one down because the
problem is so intermittent. I've collected some thoughts from our IS
guy with some guesses, theories, things to rule out, etc. All we need
is an idea of what to check (with some minor details that he can
understand) and maybe how to fix it.
Feel free to send as many possible answers as you want.
To see the problem in action, check out some examples starting at this
page: http://www.golfsmith.com/ps/category/personalization/
Here's the problem:
We're running PHP 4.3.3/Apache 1.3.28 on some Red Hat Enterprise
boxes, and we're running into a problem with pages failing to
display.
There are some flash files embedded in some of our product pages which
allow people to see the end result of the personalization that they do
to the products in question. For example, one of these flash files
will take the text written in an HTML <input> text box and make it
appear on the image of golf tees in the flash file.
The problem is, sometime earlier this year, these pages ceased
displaying regularly. Generally, the pages display correctly the first
time a user visits the page. However, after reloading once or twice,
the page ceases to display completely. Zip, zilch, nada, blank page.
-This is true whether we view a php page or the saved HTML source of
the page. (It's not php.)
-This is true whether we view the HTML in our dev, test, or live
environments, although it seems to happen _less often_ with a different
server that we haven't kept up to date. It still happens
intermittently with that server, though. (It's not an individual
host being flaky, although it could theoretically be some configured
value common among them. Can't find it, though.)
-The problem goes away if we change the path name of the flash file to
something that 404s. All the HTML still there, no flash file ==
Working page. (It's not the HTML independent of the flash.)
-The problem does not happen on other pages, even though we have a
different (smaller, non-interactive) flash file in our header. (It's
not a problem with all flash files.)
-We cannot find a pattern. Some files seem to behave (correctly or
incorrectly) more consistently than others, but we can't even agree
internally on which are the worst and best about behavior.
-Once a flash-containing page breaks, almost all of our personalization
pages become unviewable as well. This suggests that something stateful
has changed in the browser.
-Some people have had luck viewing other pages after they clear their
cache.
-This has only been viewed using IE, for a variety of reasons.
-The first <td> tag in the page-enclosing table, when removed, allows
the page AND MOVIE to display in spite of previously breaking.
However, we kind of need that. ><
My theory is that either
a)our hosts are somehow misconfigured (Though I couldn't find the
break-complicated-flash-files configuration option in our httpd.conf.)
OR
b)there's some issue on the browser side that crashes the flash movie
player (and it subsequently takes down IE's rendering engine, and
keeps taking it down every time an actionscript-bearing movie gets
played.)
If I had an strace of IE while it was failing, we might be somewhere.
Has anybody ever seen anything like this before?
- 6
- Problems with PHP 4.3.2 dynamic library loading (rawhide packages)Hi.
I've upgraded my RH 8.0 with some packages from rawhide :
httpd-2.0.47-4.i386.rpm
httpd-devel-2.0.47-4.i386.rpm
php-4.3.2-7.i386.rpm
php-devel-4.3.2-7.i386.rpm
It works fine, but i cannot load any PHP dynamic library. I get errors
on httpd start :
PHP Warning: Unknown(): Unable to load dynamic library
'/usr/lib/php4/mysql.so' - /usr/lib/php4/mysql.so: undefined symbol:
OnUpdateInt in Unknown on line 0
etc.
Same with php-mysql, php-imap, php-ldap, etc.
Any ideas ?
Thank you in advance for any help.
- 8
- upload scripthi,
I was wondering if anyonehad a script to upload files.
Thank You
- 8
- 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.
- 8
- php121Hi y'all,
I've installed PHP121 (and it works great, by the way) recently and was
wondering if there is something similar (or a plugin) for voicechat?
Thanks for any help.
Robert
- 11
- #41189 [NEW]: Multi-dimensional array in COM function causes hangFrom: rrosamond at sccd dot ctc dot edu
Operating system: Windows 2003 Server
PHP version: 5CVS-2007-04-25 (snap)
PHP Bug Type: COM related
Bug description: Multi-dimensional array in COM function causes hang
Description:
------------
This is a similar issue to the one posted by spymail at 21cn dot com on 26
Apr 2004 6:00pm UTC, Bug #28161 (http://bugs.php.net/bug.php?id=28161).
I should be able to call the COM function and set an attribute in a
multi-dimensional array using one of the functions in that COM object.
No changes have been made to php.ini. I'm using the out-of-the-box config
files and extensions packaged with the latest CVS of PHP5.
Reproduce code:
---------------
<?php
$options = "some string of options";
$objHeader = new COM("Wmrmobjs.WMRMHeader");
$objHeader->Attribute["options"] = $options;
?>
Expected result:
----------------
The attribute "options" should be set.
Actual result:
--------------
Apache (2.2.4) and/or PHP (5.2.2RC2-dev/cvs built 4/25/2007 16:30 GMT)
hangs on the script. The page never completely loads after running this
function. PHP never actually "crashes" from what I can tell. It just
simply doesn't complete processing the script. If I could get it to crash,
I would submit a backtrace.
Note, in PHP 5.2.0, the result was different: Uncaught exception
'com_exception' with message 'Error [0x8002000e] Invalid number of
parameters.
In 5.2.2RC2-dev/csv, no error is produced.
--
Edit bug report at http://bugs.php.net/?id=41189&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41189&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41189&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41189&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41189&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41189&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41189&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41189&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41189&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41189&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41189&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41189&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41189&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41189&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41189&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41189&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41189&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41189&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41189&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41189&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41189&r=mysqlcfg
- 13
- php5.2.5 with apache @ windows Vista?Hi!
I am new to PHP programming and need help.
I have Windows Vista basic installed on my computer (without IIS). I have
downloaded php5.2.5 but is it okay to run it with Apache as webserver on
windows Vista basic? Are there any specific precautions to be taken while
installing this combination?
please help,
thanks
Bipul
<div>Hi!</div>
<div>I am new to PHP programming and need help.</div>
<div> </div>
<div>I have Windows Vista basic installed on my computer (without IIS). I have downloaded php5.2.5 but is it okay to run it with Apache as webserver on windows Vista basic? Are there any specific precautions to be taken while installing this combination?
</div>
<div>please help,</div>
<div>thanks</div>
<div>Bipul</div>
- 13
- 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>
- 13
- [PHP] $POST QWilliam Stokes wrote:
> Hello,
>
> Can someone tell me what wrong or to how to manage this?
>
> //default
> $limitorig = 10;
>
> echo "<select name=\"USRlimitorig\">";
> echo "<option selected value=>$limitorig</option>";
> echo "<option>10</option>";
> echo "<option>20</option>";
> echo "<option>30</option>";
> echo <input type=\"submit\" name=\"resetlimit\" value=\"GO\">";
firstly its better to use <option value='10'> 10 </option>
this might also solve your problem if I understand your question correctly.
>
> When the form is first printed the selected default (10) value is shown OK
> and if something is selected everything is fine. If I just hit "GO" without
> changing the select menu the form fails because USRlimitorig will be empty.
> So how to post the $limitorig if user doesn't change it but hits "GO"
> anyway?
>
> Thanks
> -Will
>
|
| Author |
Message |
cmmollink

|
Posted: 2004-5-25 4:33:35 |
Top |
php-general, 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
|
| |
|
| |
 |
| |
 |
Index ‹ php-general |
- Next
- 1
- 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
- 2
- 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
- 3
- 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
- 4
- 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!
- 5
- 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 ++).
- 6
- 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
- 7
- 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.
- 8
- 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
- 9
- 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?
- 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
- 11
- 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
- 12
- 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
- 13
- 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
- 14
- 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
- 15
- \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
|
|
|