General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old November 2nd, 2003, 08:10 PM
Alicia Alicia is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Posts: 116 Alicia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 27 m 49 sec
Reputation Power: 5
pohp doubts

Hi guys,

I got some questions wish to ask you guys.

- I have seen some website just show a part of their url(without showing file extension).
e.g: www.myweb.com/log
how can i do that by using php ? do they use basename function or something else ?

- I seen a lot of sample codes use '->' symbol. I just know this symbol is used in class.. but when i look in their code, i dun see they are using any class though
e.g:
$q->query($DB, $sSQL);
$id=$DB->nextid($pho_main);
$var = (!empty($rec->body_color)) ? "'$rec->body_color'" : "\$PHORUM['default_body_color']";
can u guys give me more idea about the use of ->

- is there anyway i can check the users computer resolution and adjust the dimension of my webpage accordingly..
for instance, i created all my files in 1024*768. When a user with a screen resolution 800*600 visit my site, is there any possibility that the php code will check the user's display setting and then adjust my file dimension that fits his display setting. I just dun want to create extra files with different dimension all the time...

- i refer to one of the reference and i dun really get what is this code actually mean. I hope you guys can give me a hint about this.
code:
$current_page = ($_REQUEST[page_num]) ? $_REQUEST[page_num] : 1;
is it use like a if else statement where is page_num is nothing set it as 1 ??

please advise. Thanks

Reply With Quote
  #2  
Old November 2nd, 2003, 08:38 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Alicia,

So many questions... =)
Allow me to answer them systematically, hope this helps...


- A possible answer to your first question could be the ForceType directive in Apache
For example:
<Files log>
ForceType application/x-httpd-php
</Files>



- the arrow operator is used to refence variables and functions from a class...
in your example, $id = $DB->nextid($pho_main);
nextid() is a function from the class that $DB is declared as... (What's $DB initially declared as? $DB = new Whatever() )


- The user's monitor resolution can be determined with Javascript... try this:
<A HREF="javascript:alert('Your resolution is '+screen.width+'x'+screen.height);">
Click for your screen resolution</A>



- $_REQUEST is a superglobal variable. It is an associative array consisting of the contents of $_GET, $_POST, and $_COOKIE.... refer to http://ca.php.net/manual/en/reserve...riables.request

Reply With Quote
  #3  
Old November 2nd, 2003, 08:54 PM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
oh, i just thought of something to add... the Apache ForceType section can work in an .htaccess file... basically name a file ".htaccess" (with the decimal as the first character) and enter that text... the first line, <File log> will assume any file named "log" will be treated as a PHP file.

also, the javascript example works in Netscape 4+ and Internet Explorer 5+

Reply With Quote
  #4  
Old November 3rd, 2003, 06:31 AM
Joe4JC Joe4JC is offline
The name's Joe. Yours?
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Location: Lurking in the shadows...
Posts: 147 Joe4JC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Ok, here is my bit to contribute: the example provided in your last question is called a ternary statement. Basically, it works just the way you stated, but you can find more info at php.net.

Good luck!
Joe
__________________
Check out 4Life today!

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > pohp doubts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway