내 페이지 URL http://localhost/coursera/instructor/course.php?id=1&name=web%20development§ion=overview
같은 것입니다 및 해당 페이지에 내가
<form action="<?php echo $_SERVER["PHP_SELF"];?>" method="post">
<div class="form-group">
<textarea class="form-control" placeholder="What will students need to know or do before starting this course? Who is your target student? At the end of my course, students will be able to..." rows="8" required="" name="description"></textarea>
</div>
<button type="submit" class="btn btn-info btn-fill btn-block" name="overview">Save</button>
</form>
같은 형태를 가지고 그러나 문제는 <?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>
및 <?php echo $_SERVER["PHP_SELF"];?>
모든 $ _GET 값과 같은 URL을 반환하지 않는 것입니다.
어쨌든 같은 페이지로 돌아 가기 때문에 어떻게해야합니까? $ _Get 값을 하드 코딩 할 수 없기 때문입니다.
감사합니다.
편집 :
print_r($_SERVER["PHP_SELF"]);
이 /coursera/instructor/course.php
을 보여주는하지만 http://localhost/coursera/instructor/course.php?id=1&name=web%20development§ion=overview
그것을 할 수있는 방법을 줄까?
'에서 print_r는 제출에 비어두고하는 것이 좋습니다 ($ _ SERVER)'와 내가 양식을 제출할 때 내가 같은 URL로 반환해야 함을 원하는 @Federkun 당신이 –
를 사용할 수 있는지하지만 – Phoenix