Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

PHP script not working

Posted on 2007-07-21
3
Medium Priority
?
285 Views
Last Modified: 2013-12-12
My code is not working. When I click the submit button, nothing happens. What am I doing wrong?:

code: www.offdablockent.com/admin/amp1.txt

Thanks!
0
Comment
Question by:weikelbob
3 Comments
 
LVL 12

Expert Comment

by:oceanbeach
ID: 19539839
Hello weikelbob,

Try changing this...

<form action="amp1.php" method="POST">

to this...

<form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">

I hope this helps!

-oceanbeach
0
 
LVL 9

Accepted Solution

by:
under_dog earned 1000 total points
ID: 19539845
You've got two nested forms ... you need to change:

      echo '
       <form>
       <select name="url">';

      while(false !== ($file = readdir($handle)))
      {
            if($file != '.' && $file != '..')
            {
                  echo "<option value='$file'>$file</option>";
            }
      }

      closedir($handle);

      echo '
      </select>
      </form>';

to:

      echo '
       <select name="url">';

      while(false !== ($file = readdir($handle)))
      {
            if($file != '.' && $file != '..')
            {
                  echo "<option value='$file'>$file</option>";
            }
      }

      closedir($handle);

      echo '
      </select>';
0
 
LVL 43

Expert Comment

by:Rob
ID: 19541828
looks like you have done what @under_dog has done?  i can't see any nested forms??  Is the code working now and if not what errors are you getting?
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The title says it all. Writing any type of PHP Application or API code that provides high throughput, while under a heavy load, seems to be an arcane art form (Black Magic). This article aims to provide some general guidelines for producing this typ…
Strategic internal linking is often considered an SEO power technique, especially for content marketing. Do you need to hire an SEO agency to optimize you internal linking? No, this article will help you understand the basics of internal linking and…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question