dongmi1864 2014-05-28 01:11
浏览 48
已采纳

HTML / PHP链接通过一行按钮

I am quite certain this is an easy thing for someone to answer but since I am still pretty new to webpage design I figured I would ask it anyway. All I am trying to do is create a button to which when clicked will load another page (either .html or .php). I am doing all of this within an existing PHP page so of course it needs to be echoed.

Currently what I have tried is this:

echo '<input type="button" onclick="save_playlist.php" value="Save Playlist">';

Am I missing something very simple? I am not passing any data, simply trying to load the save_playlist.php.

Thanks in advance.

  • 写回答

2条回答 默认 最新

  • dongtang1944 2014-05-28 01:31
    关注

    Thanks to aldanux above. Here is how I solved my problem:

    echo '<input type="button" value="Save Playlist" onClick="window.location.href=\'http://example.com/save_playlist.php\'">';
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?