-
Posts
393 -
Joined
-
Last visited
Posts posted by npsari
-
-
ohh, nice guys
I noticed that these codes show how to resize an image, but what about file size
Does it also result in smaller file size
because a bmp image can still be heavy even if it is not so big
Do you see what i mean
-
Hi there
In my website, users are allowed to upload 1 image
but some people upload huge images, which slows down everything
Is there anyway that when someone uploads an image, the image is shrinked automatically and converted to gif or something
I think in Myspace for example, when i upload a huge image, something happens to it, and becomes smaller, with a bad resolution
does anyone know how can i do this in my site
Is there a way to convert hige images upon upload
Thanks
-
ohh, many thanks
i will use the code
-
Hi there
I have a table called name
In which, i have a row called names
i use this little code to show the last 3 names
$con=mysql_connect("$Connect", "$Name", "$Pass"); mysql_select_db("$Database", $con); $q = "SELECT * FROM name LIMIT 3;"; $res = @mysql_query($q); while($r = @mysql_fetch_array($res)){ print"<FONT style=\"font-size:11px\" color=\"#000000\" face=\"Arial\">$r[name]</FONT><br>"; }
but i dont want all names to be black color
I want the first name black (000000)
the second red (ff0000)
the third blue (0000FF)
How can i write the above code plz
-
i tried that (adding the comma)
however, everything dissapeards!
-
I have this little php code
in which, i join two tables
$qX = "SELECT c.category_name, c.category_id, c.category_info, t.topic_category_id FROM category c LEFT JOIN topic t ON t.topic_category_id = c.category_id ORDER BY c.category_id ASC";
I want to add this bit
COUNT(t.topic_category_id) as CNT
Where do i put it in the above code
Wherever i add it, the query does not work completely
i tried for example
$qX = "SELECT c.category_name, c.category_id, c.category_info, t.topic_category_id COUNT(t.topic_category_id) as CNT FROM category c LEFT JOIN topic t ON t.topic_category_id = c.category_id ORDER BY c.category_id ASC";
It doesnt work
-
hello there
in my phpbb forums, i am using this code to display the image of the person who posted a topic (I am joining 2 tables)
SELECT t.topic_id, t.topic_title, t.topic_views, t.topic_replies, u.user_avatar FROM phpbb_topics t LEFT JOIN phpbb_users u ON u.user_id = t.topic_poster ORDER BY t.topic_last_post_id DESC LIMIT 10
So now, the above code gets the image of the user where user_id = topic_poster
but i also want to show the image of the person who replied too
if the person who last replied is stored as letest_reply_poster in a table called replies
how can i write the above code please
-
wow, cool
ill give it a try
thanks for the help barand
-
if it is hard, thats fine
i think i know what the problem
In the table reply reply_topic_id is repeated many times for each topic, that is why the query is selecting any reply_date
-
can you lead me the way please
-
I added the GROUP BY, it worked and thinsga re not repeated, but now, the topics are not ordered by the latest reply (r.reply_date, r.reply_time)
$q = "SELECT DISTINCT t.topic_id, t.topic_name, t.topic_category_id, t.topic_date, t.topic_time, u.Image1, m.category_name, u.ID, r.reply_date, r.reply_time
FROM topic t
LEFT JOIN profile u
ON u.ID = t.topic_who
LEFT JOIN category m
ON t.topic_category_id = m.category_id
LEFT JOIN reply r
ON t.topic_id = r.reply_topic_id
GROUP BY t.topic_id
ORDER BY r.reply_date DESC, r.reply_time DESC LIMIT 9;";
Any other hint plz
-
Hi
q = "SELECT DISTINCT t.topic_id, t.topic_name, t.topic_category_id, t.topic_date, t.topic_time, u.Image1, m.category_name, u.ID, r.reply_date, r.reply_time FROM topic t LEFT JOIN profile u ON u.ID = t.topic_who LEFT JOIN category m ON t.topic_category_id = m.category_id LEFT JOIN reply r ON t.topic_id = r.reply_topic_id ORDER BY t.topic_date DESC, t.topic_time DESC LIMIT 9;";
The above code does not display distinct topic_id
it gets repeated many times
Can you tell me how to fix it please
-
Thanks much for the link
-
I am trying to create an if fucntion which will tell me if a string is a number or a letter only
i dont want anything else, not even spaces
$string = "Anything here"; if($string = [b]pattern[/b]) { print"Wrong"; } else { print"Right"; }
Can you tell me how to do it please
can you tell me the Pattern
-
Hey. thanks much, it works nice now
-
Hi
I have this Javascript
Everytime i click on a color box, this color code is typed in a tex field called C1
<form name="Code" method="POST" action="/code/scroll.php" enctype="text/plain" id=""> <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function showColor(val) { document.Code.C1.value = val; } // End --> </script> <map name="colmap"> <area shape="rect" coords="1,1,7,10" href="javascript:showColor('#00FF00')"> <area shape="rect" coords="9,1,15,10" href="javascript:showColor('#00FF33')"> <area shape="rect" coords="17,1,23,10" href="javascript:showColor('#00FF66')"> <area shape="rect" coords="25,1,31,10" href="javascript:showColor('#00FF99')"> <area shape="rect" coords="33,1,39,10" href="javascript:showColor('#00FFCC')"> <area shape="rect" coords="41,1,47,10" href="javascript:showColor('#00FFFF')"> <area shape="rect" coords="49,1,55,10" href="javascript:showColor('#33FF00')"> <area shape="rect" coords="57,1,63,10" href="javascript:showColor('#33FF33')"> <area shape="rect" coords="65,1,71,10" href="javascript:showColor('#33FF66')"> <area shape="rect" coords="73,1,79,10" href="javascript:showColor('#33FF99')"> <area shape="rect" coords="81,1,87,10" href="javascript:showColor('#33FFCC')"> <area shape="rect" coords="89,1,95,10" href="javascript:showColor('#33FFFF')"> </map> <a><img usemap="#colmap" src="http://www.example.com/code/colortable.gif" border=0 width=289 height=67></a> <input type=text name=C1 size=7> </form>
I want to do a little change to the code, so that, everytime i click on a color, the background of a Table changes
Here is my table
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" style="background-color:#8B8B00" id="Table1"> <tr> <td align="left" valign="top" width="128" height="150"> Hello There </td> </tr> </table>
Do you think you can do this for me
How can the table backround change when a color box is clicked
I have the table html ready above, i just need the Javascript which will change it
If it is easy, please show me the javascript part
-
Ok, thanks guys
I dont understand much still, but it is fair that i try myself to understand it
at least i know the name now
mod_rewrite
i will google it!!
-
Just to clarify somethings from my side
That code you gave me should be between php tags?
<? RewriteEngine On RewriteBase / RewriteRule ^(.*)$ users.php?user=$1 [L] ?>
and where is the part where i identify $1
Is there a link which i can read about all that stuff guys
-
The problem is that this website and i think the code you gave me now end the URL with .html or .php
So, it becomes something like: http://www.example.com/sara.html
It looks wrong
Do you know why this is the way
It has to end with the name only
-
Your website looks cool, but it asks me to register so i can see that page, well, i might register to see whats crackin there
anyway, thanks for the info
I will try to study theis MOD thing, and see what happens from there
But that site looks like a software or something, http://www.mod-rewrite-wizard.com/
isnt there like a php script which i can use
-
Ohh, you mean this
MOD rewrite
is what iam looking for
So, the way is not to create a directiory for each user
-
Hi there,
I have a community website
At the moment, the way of seeing a user's profile is ...
http://www.example.com/users.php?user=7
But now, I want users to have a real link
Like Myspace does, which allows you to choose an URL
How does a website do that, do i create folders for users in my public folder directory
is that how it is done?
What if there is thousands of users... Will i end up having thousands of folders in my public directory
So, Myspace has billions of folders then
Can you tell me how this is done
-
that is good news then
thanks for the reply
-
ohh i see
hmm, no reason i guess
but i am just worried
cus iam sure you know how hard it is to change the id to ID
all my site is set up to ID now
And i was thinking, what if... capital letters where disabled for mySQL tables
Images uploaded in my site are hugeeee
in PHP Coding Help
Posted
is that the part which converts it to JPG
imagejpeg($image_p, null, 100);