-
Posts
28 -
Joined
-
Last visited
Never
Posts posted by wendu
-
-
$maxWidth = 150; $maxHeight = 150; list($width, $height) = getimagesize('path/to/image'); $ratio = 1; if ($width > $maxWidth) { $ratio = $maxWidth / $width; } else if ($height > $maxHeight) { $ratio = $maxHeight / $height; } $newWidth = $width * $ratio; $newHeight = $height * $ratio;
yes you've given me this piece of code however it does not work if both the width and the hight are the same
-
hey
I'm trying to make a thumbnail of an image and I already have the code working to create the thumbnail
however I need a way to calculate values so that respecting the aspect ratio I can make the thumbnail either 150 pixels wide or high but neither can go over 150, and the aspect ratio needs to stay the same
thanks!! <33
-
sad bump? :'(
-
It is highly unlikely that your application requires two distinct databases. The idea doesn't really make allot of sense.
while that is true, it's also so very true...
-
bump? :'(
-
hey, it's wendu from sweden again!
should I create two databases rather than just one where the other would contain data that is altered by users via PHP and the other will contain data that only authorised people can edit
this way backiup would be simpler
but is there any significan't drawback with two databases? even if I connect to them both using different php handles?
-
A book title is something different, you could follow the same rules if that is what you like.
certainly I would, but what are such rules?
I've seen that words like the, and, a, an aren't capitalized, but sometimes The is and it's all so very confusing.
-
Try removing the 'p.' from the '#wrapper p.info' part.
I probably should've mentioned that I already have a working CSS link to the text I want to modify, the paragrapht
I can do font-weight: bold and it works, but when I do margin-bottom: -1em; when about 100 lines above> margin-bottom: 1em is set to EVERY P within #wrapper
-
There is not standard as far as blogs are concerned, but there is if you want to use correct grammar. Why would you want to capitalize other letters? I just don't understand any rationale behind it.
for the very same reason news articles, books and movie titles are capitalized.
how boring would this be
The lord of the rings
when it actually is
The Lord of the Rings
that's what I'm asking, how to know what words to make capital first letter and what not?
-
hey'a!
it's wendu here, with problems, d'oh
I'm keeping my own Wp blog, but I can't seem to decide how to name my blog's titles!! the issue is what terms to make with capital first letter and what not?
here's examples:
Mike and his new bike
or
Mike and his New Bike
or
Mike And His New Bike
or
Mike and HIS new bike
I'm so confused.. is there general rules what terms to capitalize? like the word "the" is better as "The"?
share and discuss this, please. thanks!
-
do you mean you want to remove the margin bottom for .info that is in p that is in #wrapper? if yes then you wrote it correctly. you just need to put a space in between p and .info and change the value to remove it.
I tried that and the CSS didn't work for that part after..
-
yeah it worked and I can even see why, it just maintains the ratio but gives the image a limit in height and width.
I'm trying
-
hey
here's my CSS
#wrapper p { margin-bottom: 1em; }
#wrapper p.info { margin-bottom: -1em; }
now the second line obviously doesn't work, but how can I remove the margin-bottom value from it without changing the first CSS rule?
-
hey
I have a PHP script that can reduce the size of an uploaded image to a percent value, but I would like a way to calculate new values for an image of any size that are at or below 1280 x 960.
if I use percent values for both the width and the height, it only works on images that are of specific size. sometimes the images are bigger and thus the percent values produce a bigger image than what I said above.
thank you all, big hugs! - wendu
edit: to be more clear, I want my script to reduce an image's size to 1280x960 or smaller, but maintaining the aspect ratio of the image, so both vertical and horizontal images would work well..
-
wow thanks! especially the loop thing will save me a lot of time and headaches
-
hey
I was wondering if there's a de-facto standard way or best practice when coding php
should I make the whole document from startt to finish <?php ?> and then use echo everytime I need to print out html
or should I start and end php tags only when php is needed? I'm presuming that loops have to be inside php at all times, and output is handled by echoing?
can you post a sample of your code so I know how to start?
big thanks. I'm a still learner
edit: I mean is this a good way?
<?php
echo "<body onLoad=\"openSomething({$one})\">\n";
?>
instead of
<body onLoad="openSomething(<php? echo {$one}; ?>)">
-
Dreameweaver wont be able to to process the php code and display your layout within design view. Instead you'll have to load your page into your web browser and then refresh the page every time you make a change
oh, yeah, so you mean when I make changes to that one page? I understand. well, just wanted to clear this up
-
hey!
when using Dreamweaver to make websites, the Design-view is not really much use when the head and the foot of the document are on separate files and are added into the main document using php's include
is there a way to overcome this? how have you done it?
-
I've been able to work something out by changing the order of the DIV's and P's, but I'm not sure I can ask them to do that on production level
however, what if I had something like this
<p id="first" style="float: left;"></p>
<p id="second" style="float: left;"></p>
<p id="third" style="float: right;"></p>
how can I make p with id third float on the same line as p with id first, without changing the order of the P's?
-
I believe the way to do this is to put the right p first and the left p second, floating them both. If you don't want to change the order, then *maybe* you can set their display to inline, and try floating them as is. I don't know if that will work or not though.
nope, thanks for your input but it didn't work
here's my code
<p style="float: left; display: inline;">This floats to the left</p>
<p style="float: right; display: inline;">This floats to the right, NOW on the same line!</p>
-
hey'as!
it's about CSS floats.
here's my code:
<p style="float: left;">This floats to the left</p>
<p style="float: right;">This floats to the right, BUT ON A SECOND LINE!</p>
my problem is, how can I make these two P's float on the SAME LINE. I could do it by placing the last P first AND removing the float property from the last P, so it would look like this:
<p style="float: right;">This floats to the right, NOW on the same line!</p>
<p style="">This floats to the left</p>
HOWEVER; I cannot change the order of these P's. I'm only doing CSS for this lil' project.
do I need to set the width on these P's, change their display property or something? this has really been a headachhe
-
Depending what you are trying to do with the referenced file you can either call it via a full path or referenced path.
If you are in /var/temp and you you need to access /var/file.txt you can either reference it is ../file.txt or /var/file.txt
If the file(s) are web accessible you could use the URL like for linking images.
that's whaat I thought, so I need to use full reference. it's okay, really.
-
Certainly!
because I'm using SSI, and have includes (php requires) I can't change those includes when I go up a directory or down a directory, it has to know itself where I'm currently calling it from, and based on that make linkes to ROOT/contact.php work (instead of ROOT/temp/contact.php)
-
hey
a newb question
how can I with PHP handle files that are in different folders?
currently, when I'm inside temp and need to reference the folder that contains temp, and a file in it, I use
../index.php
but sometimes it's not known at what level I am, so I could do a full reference, like http://example.com/index.php but that's not very wise I'm told
also, depending on the platform, I cannot use /index.php because that might not always be the root, where the Web content is
thumbnail resizing
in PHP Coding Help
Posted
any help?