WAP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreWAP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old February 18th, 2003, 04:28 PM
cmaxwell cmaxwell is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Location: UK
Posts: 67 cmaxwell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 45 m 43 sec
Reputation Power: 6
Question Deny web access to PHP WML files

Hi all,

Could someone please tell me how to deny a PC user access to WML files that are written in PHP with a .php extension?

Eg, if someone using a PC accesses the WML website, it prompts the user to download the .php file - I would rather they were not able to download the coding.

I assume it is related to setting up mime types or identifying the browser and redirecting it to a proper HTML page.

Any suggestions would be greatly appreciated.

Thanks!

Best Regards,

- Chris

Reply With Quote
  #2  
Old February 25th, 2003, 10:55 AM
nintendonextgen nintendonextgen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 18 nintendonextgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I had the same problem.

Reply With Quote
  #3  
Old July 14th, 2003, 09:32 AM
m_stan m_stan is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 3 m_stan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Did you ever get a workaround for this ? I have a similar problem.

I have a WML file I want to access from both a WAP and regular PC browser. The file has a .php extension with the WML headers set at the top. I can access the the script from a WAP phone fine and also from the PC, except that I get the messagebox stating the the file format is unknown. The script does what it's supposed to - its just that I get this ugly message. I want to be able to run the script as a cron job as well as a manual job from both PC and WAP. Therefore I need to be able to determine what type of device is accessing the page and then do something appropriate. Unfortunatly, as far as I know you cannot do any processing before setting the header info.

Any ideas (apart from having to seperate scripts) ?

Reply With Quote
  #4  
Old July 14th, 2003, 01:24 PM
jabba_29's Avatar
jabba_29 jabba_29 is offline
Back in HEL
Dev Shed God 8th Plane (8500 - 8999 posts)
 
Join Date: Feb 2002
Location: Finland
Posts: 8,660 jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)jabba_29 User rank is General 10th Grade (Above 100000 Reputation Level)  Folding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner FolderFolding Points: 57777 Folding Title: Beginner Folder
Time spent in forums: 3 Months 3 Weeks 4 Days 1 h 21 m 33 sec
Reputation Power: 1618
Send a message via ICQ to jabba_29 Send a message via AIM to jabba_29 Send a message via MSN to jabba_29 Send a message via Yahoo to jabba_29 Send a message via Google Talk to jabba_29 Send a message via Skype to jabba_29
Facebook
I got this from Evil Walrus, I haven't tried it yet though (essentially, just stick it at the top of your page before html is outputted. I am sure this is apaptable if you are using a template system or the likes):

PHP Code:
<?php 
$mobilephone 
preg_match("!Nokia|KDDI|SHARP|portalmmm|UP.Browser|Wapagsim|DoCoMo|Alcatel|ATTWS|Doris|Hutc3G|J-PHONE|Java|KGT|LGE|MOT|ReqwirelessWeb|SAGEM|SIE-|SonyEricsson|Teleport Pro|UPG1!"$HTTP_USER_AGENT); 

//parts of some different user_agent strings are between the |'s. 
    
if ($mobilephone)   
      include(
"cellphone.php"); 

//If a cellphone is detected you see this page. 
   
else 
      include(
"computer.php"); 

//If a computer is detected you see this page. 
?>
__________________
Cheers,

Jamie


# skiFFie | Home of the 'accessibility module' for Drupal
# Jamie Burns [me] Accessibility Module [drupal]
# guidelines | search | wap resources | not getting help | fold to cure

# Any form of employment is strictly prohibited ......


__________________

Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.

__________________

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreWAP Programming > Deny web access to PHP WML files


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 3 hosted by Hostway