Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
163
rated 0 times [  170] [ 7]  / answers: 1 / hits: 59676  / 13 Years ago, sun, october 23, 2011, 12:00:00

I want a new page to be opened when a button is pressed. Here is my code so far:



<input name=newThread type=button value=New Discussion onclick=window.open('Political/Thread/thread_insert.php')/>


It fails, however, ..I think the path is incorrect, but I dont know why..cause it is the correct directory path...


More From » php

 Answers
42

Your code is correct (valid and function), you problem is the your path.



Remember that page location is the page inside the web server and relative to the current page location.



So if your web server root is for example c:wampwww then the web address test/test.php will look for the real page of c:wampwwwtesttest.php. However the same address encoded into a page already in a subdirectory will be relative unless it starts with /
So from the page test/test.php in the above example the link to test/test.php will become /test/test/test.php (with a real path of c:wampwwwtesttesttest.php)



If you have copied the link from another page somewhere this is probably the problem


[#89483] Thursday, October 20, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaidyn

Total Points: 633
Total Questions: 102
Total Answers: 100

Location: Trinidad and Tobago
Member since Thu, Dec 1, 2022
2 Years ago
;