Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




GD Default DPI


I'm currently making a website that needs to edit images with adding text,
the problem is, the picture starts at 300 DPI (pixels/inch), but after GD
edits the image, it's set to 72 which i read to be the default value GD
always uses. is there a way to edit that default to a higher number, if not
are there other ways to edit images through php and still keeping the
original DPI.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Database Stores Default Number Everytime, But I Havent Set A Default Number??
Im having some problems with my database. Everytime i store a number which is longer than 10 numbers the script or database puts this number into the database: 2147483647. Its does this everytime no mather how i write the numbers and nomather how long the number is, it just needs to be over 10.

I have set any default value in the database and to be sure i havent i tried deleting the table, but same thing happends again???

Magic_quotes_gpc On By Default In PHP 4.3.3?
Prior to upgrading to PHP 4.3.3 (Windows), magic_quotes_gpc was turned off in the php.ini file. However, when I upgraded, I told the installer overwrite my previous php.ini files. I didn't have anything special in my previous version of php.ini and I wanted a clean slate.

After I upgraded to 4.3.3, I noticed that my scripts were acting strange, specifically form input. I checked php.ini and found that magic_quotes_gpc was turned on.

I unzipped the installer exe and upon inspecting the php.ini, I found the default php.ini included had magic_quotes_gpc On.

I thought they were going to set magic_quotes_gpc off by default in the later versions.

Anyone know why they did this? Was it a mistake?

What Is Better As A Default Value: NULL Or ''?
I would like to collect some statistical data and then make some reports on it. I'm creating tables for this task and i'm not sure what is better for filling default values: NULL or ''. What is optimal for storage purposes and for further reports creation?

Default Image
How can I write a function in such a way that it would look for a specific image to load. If that image exists on the server it will load it, if not it will load a default image.

Dropdown - Default Value
I want to be able to have a drop down list that doesn't necessarily have the first item as the default. The content is being populated by PHP so I have no idea how to do it.

Default Variable Value
Does php provide a built in way to use a variable's current value if
that variable is already set but to use a default value otherwise.
That is, a more compact syntax for:

$some_var = isset("$some_var") ? $some_var : "default value";

Set Column Default
we have a table  sistock with column cameramodel  varchar(30) and try to  set default value to blank with the following:

ALTER TABLE SISTOCK CHANGE COLUMN CAMERAMODEL CAMERAMODEL ENUM ('INSTOCK',
'BACKORDER','SERVICE','OBSOLETE') DEFAULT '';

and we get an error at the mysql prompt;

ImageString: How Do I Use A Font That Is Not One Of The Default 5?
I am playing with imagegd for generating images, and was wondering if there is a way I could use a font that is not one of the default 5? I remember reading somewhere about a TT font library for imagegd, but don't remember the specifics. If someone could point me in the right direction I would appreciate it.

Problem On Default Value : : MySQL
Problem on default value : : MySQL

I am facing problem in this line

`datetime` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,

when I tried to crate a new table in MySQL(version 3.23.47-nt)

Default Option On Select Box
I need to make a field in a admin form to be a drop down select box. I have the field right now as: PHP Code:

Using Default DB, User, Password
How do I use odbc.default_db, odbc.default_user and odbc.default_password defined in php.ini in the mssql_connect() function? I do not want to define these vars globally at the application level for many reasons. Shouldn’t calling the function without any parameters force PHP to look at the INI file for the defaults?

Form With To Submits, Which One To Default To?
Say, I have a form. Both cancel and save (in that order) are submits, then in the code I check which button was pressed. The point is that I want the save button (2nd) to be default, not the cancel. Is there a way (in js?) to "focus" the other button? One other way to be some simple js, which submits the page anyway......

Object Default Value In Constructor
I'm trying to write a class with a constructor that takes a single object
parameter. So far so good, but I can't for the life of me make the parameter
optional. I understand how to do it with a numerical or textual parameter,
but not with an object. I tried null, but it doesn't work.

class A
{
}

class B
{
function B($a = ???)
{
if (!isset($a)) $a = new A;
}
}

Default Selection From Query
I'm having difficulty trying to have a DEFAULT selected record from a query in my dropdown box (code below). I have about 20 records in a 'facility' table, which listed names of our company's locations. I want to default select one of those records "exton" to be selected in my dropdown box. Code:

PHP Default Host Best Practices
I've got my dev and production environments all setup, and the mysql
DBs working fine. What need to do is set the mysql.default_host option
in php.ini to be one thing on dev, and something different on
production. Unfortunately, my web host doesn't allow me to mess with
php.ini.

So, what's the best way to specify a different host to mysql_connect()
on dev and production. Yes, I could manually edit the variable
everything I FTP, but I'd rather not.

Should I use a global variable in a separate include file? Other
options?

Default Argument Values
something like this possible in PHP:

function foo($a=1, $b=2, $c=3) {
//...
}

foo($b=2);

Will this assign $a and $c to default values?

How To Overwrite Default Php Installation
On my linux system php seems to have been installed by default. When I
type:

"which php" it tells me /usr/bin/php

I installed php and it has put an executable in the /usr/local/bin/php

"which php" still says /usr/bin/php

"whereis php"
php: /etc/php.ini /usr/bin/php /usr/local/bin/php /usr/local/lib/php
/usr/local/lib/php.ini

/usr/local/lib/php -v shows the new version but php -v shows the old
version.

How can I correct this problem?

I want to run the command php -v and it shows the newest version.

I have already tried removing /etc/php.ini /usr/bin/php

Default Value To Insert Into MySQL
What should I insert as the default value if a form field is blank? My fields don't currently accept null.

if($_POST['height']) {
  // error checking
  $height = $_POST['height'];
}
else {
  $height = '';
}
Should $height be equal to '', NULL, or maybe 'NULL'? I'm thinking 'NULL' incase I or someone else decides to change the field to accept null?

PHP Session Default Timeout
what is the default Session Timeout for php...is there a way to increase this on the web server I am hostign my php scripts on..

Default Error Message
How to prevent the default error message from being  displayed ?

Default Date Drop Down
Ive got the following drop down which works perfectly, although the default date is set to todays date. Could you please advise me on how to set it to show -- -- ---- instead of 31 05 2007? Code:

Php's Default Character Set
Where does it say that on php.net, that iso8859 is the default charset for strings? Can't find anything about it.

Display A Default Image?
Is there an "if" statement I can use to check if an image exists in a certain directory, and if it does display it, but if it doesn't exist then display another image in a different directory? I've written simple "if" statements for text display, but nothing like this. Is this possible?

It might help to tell the scenario. I am putting together templates for teacher web sites. If they wish, they can upload their own logo into their upload directory to display at the top of the page, but if they choose not to upload their own logo I want the default (district) logo to appear there. The default logo is located in another directory on the same server.

Default Error Page If No Rows
If there are no rows in the result of my query, instead of just showing some text in the browser saying no rows found, could i redirect to a standard error page using this function?

Need Access To Default File Attributes
When I was first learning php, I created an upload script. The basics of the script had:

<form method="POST" ENCTYPE="multipart/form-data">
<input type="file" name="FILE">
<input type="submit" name="SUBMIT" value="Upload">
</form>

Then in the submit section, it accesses the filename and filesize by virtue of a default php ability to extract these attributes by using: $FILE_name and $FILE_size (where _name gives the name of $FILE and _size gives the size of $FILE).

if($SUBMIT)
echo " Filename: $FILE_name <br> Filesize: $FILE_size";

Also, I did add the necessary lines to handle the post variables, like so:

$FILE = $_POST['FILE'];
$SUBMIT = $_POST['SUBMIT'];

I have tried to mimic this script in a new upload script, but am unable to access those same attributes (_name and _size).

At the time of my original upload script, we were running it on a Linux server (but I don't remember what we were running for a php version). Currently, I am running PHP 4.2.3 on Mac OS 10.2.8 server.

One thought I had was that maybe PHP 4.2.3 no longer supports _name and _size. Or, maybe I am not handling the retrieval of the POST var for the file correctly? I wonder this because I did try print_r($_POST) and I only got the submit returned as a post var.

Dropdown List - Trying To Get Default Populated From Db.
Nooby question but when I try and get this to work (it should identify which
rows in the database have GK, MID, DEF, FWD against them and then put
SELECTED into the option value to give a default of what the entry is
currently) it just adds SELECTED to all the results as if $row["Position"]
is returning true against all four conditions? What am I doing wrong? CODE:..

Entering The Date As Default Within A Form
Anyone know how to enter the time into a form or a website that might
tell how? I'm using the following html code and trying to get the
time to default into the text box. thanks

html code
<tr>
<td><b>Date:</b></td>
<td align="left"><input type="text" name="date" size="8"
maxlength="8"></td>
</tr>

php code
<? print strftime("%m/%d/%Y"); ?>

Default Function Argument Issue
function test($foo=array()) {
echo gettype($foo);
implode(' ',$foo);
}

foo();

This code will output:
null

and generate the error
Bad arguments. in .... on line x ( bad implode args )

what's the deal?
$foo should be an array!

Send Default Apache 404 Error From Php
How can I trigger the default Apache 404 error from PHP? I don't want
to specify a custom handler, I want the default handler. The reason is
that I am using mod_rewrite with Apache for my site. If certain a
certain page is requested that is not published, then I want to send
the apache default 404 error page. Currently, I am doing this to
return a custom error.

if($pageNotPublished) {
header("HTTP/1.1 404 Not Found");
// How do I send the default apache 404 message
// instead of the message below?
print("<html><body>HTTP 404 - Not Found</body></html>");
exit();
}

The default 404 error page has more details,

Default Home Page Under Xampp.
Is there a way to change default home page under Xampp, so that when I
type http://localhost it would go to a home page other than page with
popup asking for Xampp authorization.

How To Change PCRE Default Delimiters
I try to use alternative delimiters for a regular expression.
When will it be supported?

www@mike:/home/www > /usr/local/bin/php -a
Interactive mode enabled

<?php
preg_match('m!A(d*)B!', 'A12345B', $X));
?>
X-Powered-By: PHP/4.2.3
Content-type: text/html

<br />
<b>Parse error</b>: parse error in <b>-</b> on line <b>2</b><br />

http://perldoc.com/perl5.8.4/pod/perlrequick.html

How Can I Delete The Default Apache And Php On Linux?
I installed php4.0.2 and apache 1.3.12,but I use the function phpinfo() checked the version of the php,it always tells me it is 3.0.15,so I want to delete the default apache and php on linux,so I can install new php4 and apache and it can connect to the mysql.By the way how can I get rid of the php and apche which the in linux when I installed the linux.

Setting Imagecreatetruecolor() To Have Transparency As Default
Does anyone know if its possible to set imagecreatetruecolor() to initialise
with transparency
rather than black?

Default Select Drop Down Menu?
I have a drop down menu populated via a script that pulls all categories from the category table. However, when a user clicks to view a specify category (i.e. Toys), I want the drop down menu to display toys as the default value. Code:

MYSQL: How To Set A User's Default Database?
Is it possible to set a user's default database for MySQL database?

Instead of having an additional line of command, i.e:

mysql> use database <database_name>

Perhaps there are parameters I can set up a default database for a user when
she log on to mysql.

Default Redirect To Webpage For Authentication?
I'm hunting for a script that would allow me to place a wide-open
wireless access point in my client's business. Then, anyone connecting
and then surfing a webpage would be redirected to a default webpage for
their username/password. Once they log-in, they can surf as normal
until they close their browser. Each new browser session would require
a new cookie/login to surf the web.

Has anyone seen a script that can do this? Or, should I be looking at
some sort of proxy server product?

Setting An Image Field As A Default?
In my application I have 6 image fields. If a user uploads an image they must upload an image 1 which is the main image. So I dont want them to be able to jump to the 2nd or 3rd fields and upload their file there. I am just not sure how to go about defaulting them to upload image 1 first?

Default Selection Radio Button
I have a table where users input a date, time, and quantity for a reservation.  On my page ... because I have a junk calendar and coding, every time you click a different month on the calendar or click the "book now" button without entering all the necessary data, the page refreshes and erases all the data. 

One significant problem is that the times display as radio buttons. Some tours have one time and some have multiple times. On the page, if there is only one time, then to make it easier for users to book tours, I inputted CHECKED into the html code. But unfortunately if the tour has multiple times, then CHECKED doesn't work for the first radio button, it defaults the last radio button because of the php loop. Code:

Conditional Statement For Default Case
I'm trying to create a conditional statement for my menu that will check to see if the page is on the default case. Code:

Automatic Select Form Field Default
I would like to allow registered users to my site the ability to change your personal information. Let's say the country in which they are in.

The country field is a drop down list. So its supposed to read from the table and make the value the default. How am I going to do this?

Mysql - DEFAULT '' Defined Yet NULL Inserted
My database was inserting NULL for empty strings so I changed the field
definition with this query:

ALTER TABLE `myTable` CHANGE `myUrl` `myUrl` VARCHAR( 255 ) NOT NULL
DEFAULT ''

No error was reported following the query and yet I still get NULLs on
insertions.

MySQL Datetime Field Default Now() Fails
I have a mySQL database table with a column field datatype of datetime that
I set up in the original create table statement like this:

create table nnet_usermetadata (
....
nnet_record_entered datetime default 'now()'
)

However, upon execution, each time a record is entered into
nnet_usermetadata the results are:

00-00-0000 00:00:00

Is there a way I can always ensure that the current date and time are always
entered into the datetime field?

Omitting The Break; In The Default: Section Of A Switch()
Is there any need to keep the final break in a switch which uses a default
at the end? I.e:

switch ($data) {

case 'foo':
# Action
break;

case 'bar':
# Action
break;

default:
# Action
break; # Is there any reason to keep this line?
}

I'm trying to aim for best practice levels of coding. (e.g. using ''
rather than "", etc. etc).

As far as I can see there seems no reason to do so and it improves
readability of code through and is (ultra-marginally) more efficient.

Sending Html Email Using PHP Default Method
Can we send HTML emails using PHP's default mail method?

PHP Conditional Setting Of Radio Button Default
I'm working on an edit inventory form, and I'm pulling a field from my database that's going to be a 'Y' or 'N'.  Based upon this, I want to default the 'customizable' radio button to either checked="Y" or checked="N". Code:

Using Update To Give A Table Default Values
I have a table that is already created but all the fields are set to NULL by default. How would I go about changing this with a mysql_query(), so that if only say 2 of 5 fields are given a value for a column the rest will fill with the default value?

Change Default Value Of HTML FileUpload Object
I am having trouble changing the default value of an HTML FileUpload Object. I googled this problem and it seems that the only way to do this is by using JavaScript.

Ideally I would like to avoid using the latter, because the form which contains this object, is being created dynamically within php braces echo"<td> <input type="file" name="pics1"></td>";and therefore adding JavaScript to the whole thing might makes things a bit nasty.

Image Create Default Background Color
I have a script that crops and image and resizes it, but that's not the problem.

If the image is smaller than the crop area, PHP just fills it in with black.

Is there a way to make PHP fill it in with white instead of black?

Enabling/Disabling InnoDB With Default Mysql Installation.
If you install mysql and find innodb table type is not available,
follow these steps.

find my.cnf file. usually my.cnf file resides in "mysql/bin" folder.
Then search for "skip-innodb", if you find the line then comment it as
"#skip-innodb", then retart you mysql daemon.

Thats it

To disable, uncomment "skip-innodb" or start mysql daemon with
following command

mysql --skip-innodb

thats it.


Copyright © 2005-08 www.BigResource.com, All rights reserved