•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 391,574 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,828 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 460 | Replies: 11
![]() |
•
•
Join Date: Nov 2006
Location: South Wales
Posts: 159
Reputation:
Rep Power: 2
Solved Threads: 10
What if the user disabled Javascript?
If you find my post useful please add to my reputation!! Thanks!
ajtrichards web solutions
http://www.ajtrichards.co.uk
ajtrichards web solutions
http://www.ajtrichards.co.uk
•
•
•
•
Javascript will execute the code. Just try putting an alert, where the header type is
Header("content-type: application/x-javascript"); you will see :-)
That is interesting...
I've created an example here: http://de-test1.appjet.net/
But it doesn't execute for the browsers I tested.
It does not seem to me that a JS resource should be executed on its own, but meant to be executed in the context of another application, such as a HTML Document on a browser, XUL document in Firefox, as Actionscript in Flash etc. etc.
•
•
•
•
Like I said before a header WOULD NOT WORK since I have to pull information from a database first. You MUST put a header at the top of the page.
The HTTP Response Header just needs to go before the HTTP Response body, it does not matter where in the PHP script it is issued...
You can use output buffering if you need. http://www.php.net/ob_start
eg: for a redirect:
// at the top of your page start the HTTP buffer
ob_start();
// heres your HTML
echo '<p>I am a paragraph</p>';
// then you decide to redirect, clear the buffer
ob_end_clean();
// issue the change in location.
header('Location: http://example.com/'); www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
- Previous Thread: inbox
- Next Thread: link protector help


Linear Mode