douniao8687 2013-11-11 02:03
浏览 351

<script> document.location.href =''; </ script>&转到页面相关问题

<? echo "<script> document.location.href='main.php';</script>"; ?>

This code is running well

But, sending values ​​from the form page

<form action="smssend.php" method="post" id="quickform"> 
<input type="hidden" name="returnUrl" value="<? =PHP_SELF?>"> 

This gives a value to the next page

<? echo "<script> document.location.href='$_POST[returnUrl]';</script>"; ?>

Run time error occurs if the source and the page will not move.

Does what I'm wrong?

Under the form page I received the message from the phone number with reference to the page source to handle less.

<?php

$config['SMS_ID']="test";
$config['SMS_PW']="test1234";
$config['cf_tel']='01234567';

$post_data = array(
            "remote_id"       => $config['SMS_ID'],
            "remote_pass"     => $config['SMS_PW'], 
            "remote_num"      => 1, 
            "remote_reserve"  => 0, 
            "remote_phone"    => $_POST[number],
            "remote_callback" => $config['cf_tel'],
            "remote_msg"      => $_POST[counsle]
        );

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mymunja.co.kr/Remote/RemoteSms.html" );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$msg = curl_exec($ch);
curl_close($ch);
?>
<? echo "<script> alert('Done');</script>"; ?>
<? echo "<script> document.location.href='$_POST[returnUrl]';</script>"; ?>
  • 写回答

3条回答 默认 最新

  • douweng3383 2015-04-02 06:37
    关注

    Try use <html></html> tag.

    <? echo "<html><script> alert('Done');</script></html>"; ?>
    
    
    <? echo "<html><script> document.location.href='$_POST[returnUrl]';</script></html>"; ?>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化