UK Webmaster Talk - Online Marketing - SEO


 

Form Probllems

This is a discussion on Form Probllems within the Php and MySQL forums, part of the Programming / Scripting / Coding category; Could somebody tell me why this is not working? When i enter stuff into the text box and click Search ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 13-08-2005, 01:34   #1 (permalink)
Newbie
 
Join Date: Aug 2005
Posts: 1
iTrader: 0 / 0%
kripz is an unknown quantity at this point
Default Form Probllems

Could somebody tell me why this is not working?

When i enter stuff into the text box and click Search it just spits out hihihihihihihi and so on until the server crashes.

Code:
<form action="<? echo ($_SERVER['PHP_SELF']); ?>" method="post">
<textarea name="text" cols="50" rows="20" wrap="OFF"></textarea>
<input type="submit" name="submit" value="Search">
<input type ="hidden" name="action" value ="Search">
</form>
PHP Code:
<?php
if ($_POST['action'] == "Search"
        {
                        
$cock $_post['text'];
                        
$file fopen($cock'r');
                        while (!
feof($file)) 
                        {
                                
$lines fgets($file);

                                if (
strpos($lines'VALID') !== FALSE
                                    {
                                        
$guids substr($lines0strpos($lines'('));
                                        
$guids1 substr($guids, -8);
                                        
$names trim(substr($linesstrpos($lines')')+1));
                                        echo 
"<b>Guid:</b> $guids1 <b>Alias:</b> $names";
                                        echo 
"<br>";
                                        
//mysql_pconnect ($DBhost, $DBuser, $DBpass) or die("Unable to connect to database");
                                        //mysql_select_db ($DBName) or die("Unable to select database $DBName");

                                        //if (mysql_num_rows(mysql_query("SELECT * FROM $table WHERE guid = '$guids1' and WHERE alias = '$names'")) < 1) //{
                                        //        $sql = mysql_query(" INSERT INTO $table (guid, alias) VALUES ('$guids1', '$names') ");
                                        //}
                                        //else print 'Entry already listed';
                                    
}
                                    else 
                                        {
                                        print 
'hi';
                                        }
                        }
            }
            else 
                {
                print 
'something';
                }
?>
kripz is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 17-08-2005, 03:29   #2 (permalink)
*poke* *poke*
 
Join Date: Apr 2005
Posts: 134
iTrader: 0 / 0%
mck9235 is on a distinguished road
Default

Try changing:
PHP Code:
if ($_POST['action'] == "Search"
to:
PHP Code:
if($_POST['submit']) 
__________________
| - The Fast Track - |
Thanks to WMT for the new domain!
mck9235 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-10-2005, 15:00   #3 (permalink)
Cool Newbie
 
Join Date: Oct 2005
Location: oxford
Posts: 43
iTrader: 0 / 0%
talby101 is an unknown quantity at this point
Default

or try this :

if (isset($_POST["submit"])){
}

http://uk2.php.net/manual/en/function.isset.php for more info
talby101 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
form, probllems

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Form to Mail HostYorkshire Php and MySQL 0 08-01-2007 19:20
Electronic Form bradk Website Design Forum 7 03-03-2006 21:34
Form help JsPLACEwebby Programming / Scripting / Coding 2 05-12-2005 11:25
Cpanel/WHM Auto Form KF1 Php and MySQL 15 07-07-2005 16:43
Contact Us Form? Departed Programming Articles 0 22-04-2005 00:31


All times are GMT +1. The time now is 02:15.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41