php-general Digest 4 Jun 2007 06:44:54 -0000 Issue 4828
Topics (messages 256027 through 256034):
Re: How can I DomDocument->renameNode?
256027 by: itoctopus
256028 by: tedd
Single Sign On
256029 by: Sudheer Satyanarayana
256030 by: Robert Cummings
Is the GD module standard?
256031 by: Dave M G
256032 by: Robert Cummings
256033 by: Greg Donald
Making thumbs same size
256034 by: Humani Power
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
Create a copy manually and then rename the node.
--
itoctopus - http://www.itoctopus.com
""Eric Wiener"" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Apparently renameNode is not yet implemented into Dom, so how can I
rename a node without affecting its value and/or child nodes?
I have tried making a new node, inserting it before the old node then
removing the old node but I could not figure out how to get the
nodeValue to include the child nodes, so they get stripped out leaving
only the text value.
--- End Message ---
--- Begin Message ---
I have tried making a new node, inserting it before the old node then
removing the old node but I could not figure out how to get the
nodeValue to include the child nodes, so they get stripped out leaving
only the text value.
You might try something like this:
function replaceNode() {
var inChoice = document.getElementById("grafCount").selectedIndex;
var inText = document.getElementById("textArea").value;
var newText = document.createTextNode(inText);
var newGraf = document.createElement("p");
newGraf.appendChild(newText);
var allGrafs = nodeChangingArea.getElementsByTagName("p");
var oldGraf = allGrafs.item(inChoice);
nodeChangingArea.replaceChild(newGraf,oldGraf);
}
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Hi,
We have three web sites
a) example1.com
b) example2.com
c) my.example2.com
Our sites include exclusive pages for registered users. All user account
management tasks are handled by my.example2.com including registration,
modification, cancellation, etc. We would like to create a single sign
on system for all the three web sites. The user would sign on with a
single username and password to all three web sites. For example, when
the user visits a membership page in example1.com he would be prompted
to sign on to his account. His credentials are stored in
my.example2.com. my.example2.com is now fully functional. After the
successful sign on, the user would be redirected to original membership
page in example1.com.
How would I pass the information from my.example2.com to example1.com
about the authentication status of user?
We use MySQL database to store and retrieve user account details in
my.example2.com. The web host does not allow remote database connections.
Thanks,
Sudheer
--- End Message ---
--- Begin Message ---
On Mon, 2007-06-04 at 08:06 +0530, Sudheer Satyanarayana wrote:
> Hi,
>
> We have three web sites
> a) example1.com
> b) example2.com
> c) my.example2.com
>
>
> Our sites include exclusive pages for registered users. All user account
> management tasks are handled by my.example2.com including registration,
> modification, cancellation, etc. We would like to create a single sign
> on system for all the three web sites. The user would sign on with a
> single username and password to all three web sites. For example, when
> the user visits a membership page in example1.com he would be prompted
> to sign on to his account. His credentials are stored in
> my.example2.com. my.example2.com is now fully functional. After the
> successful sign on, the user would be redirected to original membership
> page in example1.com.
>
> How would I pass the information from my.example2.com to example1.com
> about the authentication status of user?
>
> We use MySQL database to store and retrieve user account details in
> my.example2.com. The web host does not allow remote database connections.
I'd pass a session identifier to example1.com, then when example1.com
detects a session synch, it would use a webservice to call home to
my.example2.com and request verification of the session. You will
probably want to have some extra checks in place too, like a timestamp
that expires, maybe user browser information, etc to help validate.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
PHP General,
I have been using the imagepng() function in my local testing
environment for a while now to make CAPTCHA images.
In my testing environment, I hadn't done any customization to my PHP set
up. I went with the default set of installation options that Ubuntu
offers for a LAMP server.
Recently, I uploaded my site to a web hosting server, and the CAPTCHA
would not display.
At first, I didn't understand that it was a module issue, because I
thought the imagepng() function was standard in PHP.
However, by using the phpinfo() command on my hosting service, I
realized they don't have the GD module installed.
So my assumption that imagepng() will be available on any standard
installation of PHP is wrong.
However, I'm surprised that it wouldn't be as common as, say, the MySQL
module.
Is it that my Ubuntu installation comes with an unusual amount of bells
and whistles? Is it that my web hosting server is lacking in what can be
expected for standard PHP features?
I want to write code that most people can expect to run on their hosting
services without having to reconfigure their PHP installation. So, can I
expect that most servers would have the GD module? If not, what do
people usually do to manipulate images?
Thank you for any advice.
--
Dave M G
Ubuntu Feisty 7.04
Kernel 2.6.20-15-386
--- End Message ---
--- Begin Message ---
On Mon, 2007-06-04 at 12:47 +0900, Dave M G wrote:
> PHP General,
>
> I have been using the imagepng() function in my local testing
> environment for a while now to make CAPTCHA images.
>
> In my testing environment, I hadn't done any customization to my PHP set
> up. I went with the default set of installation options that Ubuntu
> offers for a LAMP server.
>
> Recently, I uploaded my site to a web hosting server, and the CAPTCHA
> would not display.
>
> At first, I didn't understand that it was a module issue, because I
> thought the imagepng() function was standard in PHP.
>
> However, by using the phpinfo() command on my hosting service, I
> realized they don't have the GD module installed.
>
> So my assumption that imagepng() will be available on any standard
> installation of PHP is wrong.
>
> However, I'm surprised that it wouldn't be as common as, say, the MySQL
> module.
>
> Is it that my Ubuntu installation comes with an unusual amount of bells
> and whistles? Is it that my web hosting server is lacking in what can be
> expected for standard PHP features?
>
> I want to write code that most people can expect to run on their hosting
> services without having to reconfigure their PHP installation. So, can I
> expect that most servers would have the GD module? If not, what do
> people usually do to manipulate images?
Every host I've ever used has had GD installed. If they didn't offer GD,
I'd switch. I think it's a safe bet to assume most realistic hosts have
GD.
Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'
--- End Message ---
--- Begin Message ---
On 6/3/07, Robert Cummings <[EMAIL PROTECTED]> wrote:
Every host I've ever used has had GD installed. If they didn't offer GD,
I'd switch. I think it's a safe bet to assume most realistic hosts have
GD.
Same here. Been using it for years, never had to ask for it to be installed.
--
Greg Donald
http://destiney.com/
--- End Message ---
--- Begin Message ---
Hey hi!!.
I have a few pages that uploads images to the apache server and makes a
registry on a mysql database. Everything is going well just for a few
details.
When I make the upload for an image, it creates me a thumb image, but not as
I want. For example, if I have an image that its of 2000 x 2000 px, the
thumb created is 200 x 200, If I upload another with 300x300 px, my thumb
will be 30x30 px, making look the gallery pretty bad. The only thing that I
need is that all my thumbs were on the same size.
I've tried to modify the thumb width and height size, but doesnt work..
Probably I am not undersatnding hoy to use the resampling() tool.
here is my code.
<?php
include("connection.php");
//make variables avaliable
$image_caption = $_POST['image_caption'];
$image_username = $_POST['image_username'];
$image_tempname = $_FILES['image_filename']['name'];
$image_date = date($_POST['image_date']);
$today= date("Y-m-d");
//upload image and check for image type
$ImageDir="/var/www/apache2-default/images/";
$Imagethumb=$ImageDir."thumbs/";
$ImageName=$ImageDir . $image_tempname;
if (move_uploaded_file($_FILES['image_filename']['tmp_name'],
$ImageName)) {
//get info about the image being uploaded
list($width, $height, $type, $attr)= getimagesize($ImageName);
//insert info into the table
$insert= "insert into rsiis_images
(image_caption,image_username,image_date,image_date_upload)
values
('$image_caption','$image_username','$image_date','$today')";
$insertresults=mysql_query($insert)
or die(mysql_error());
$lastpicid=mysql_insert_id();
$newfilename=$ImageDir . $lastpicid .".jpg";
if($type==2){
rename($ImageName, $newfilename);
} else {
if ($type==1){
$image_old=imagecreatefromgif($ImageName);
}elseif ($type==3){
$image_old=imagecreatefrompng($ImageName);
}
//"convert the image to JPG
$image_jpg=imagecreatetruecolor($width,$height);
imagecopyresampled($image_jpg,$image_old, 0, 0, 0, 0, $width,
$height,$width,$height);
imagejpeg($image_jpg,$newfilename);
imagedestroy($image_old);
imagedestroy($image_jpg);
}
$newthumbname=$Imagethumb.$lastpicid.".jpg";
//get dimensions of the thumbnail
$thumb_width=$width*0.10;
$thumb_height=$height*.10;
//Create thumbnail
$largeimage=imagecreatefromjpeg($newfilename);
$thumb=imagecreatetruecolor($thumb_width,$thumb_height);
imagecopy($thumb, $largeimage, 0, 0, 0, 0,$width,$height);
imagecopyresampled($thumb, $largeimage, 0, 0, 0, 0,
$thumb_width,$thumb_height,$width,$height);
imagejpeg($thumb,$newthumbname);
imagedestroy($largeimage);
imagedestroy($thumb);
$url="location:showimage.php?id=".$lastpicid;
header($url);
}
?>
thanks for your help
--- End Message ---