Jump to content

phpretard

Members
  • Posts

    821
  • Joined

  • Last visited

    Never

Posts posted by phpretard

  1. When I use:

     

    <input type=submit name='MainForm' Value=Submit>

     

    if (isset($_POST['MainForm'])){

     

    echo"SUBMITTED";

     

    }

     

    THIS WORKS

     

    --------------------------------------------------

     

    When I use:

     

    <input type='image' name='MainForm' src='form_pieces/img/b_next.gif'>

     

    it does not work??

     

    Any Thoughts?

     

    ---index.php--

    <?
    if (isset($_POST['MainForm'])){
    
    echo"SUBMITTED";
    
    }
    ?>
    <html>
    <head>
    <link rel="stylesheet" type="text/css" href="form_pieces/form.css">
    <script src='form_pieces/js/misc.js'></script>
    </head>
    
    <body>
    
    <?
    include 'form.php';
    ?>
    
    <body>
    
    </body>
    
    </html>

     

    ---form.php---

    <?
    echo"<form action='' method='post'>";
    
    include 'bus_type.php';
    
    include 'main/main_info.php';
    
    include 'corp/main.php';
    
    include 'partner/main.php';
    
    include 'llc/main.php';
    
    include 'submit.php'; // <-- The button is in there
    
    echo"</form>";
    ?>
    

  2. $Name=Abuse%20Counseling%20&%20Treatment%20(ACT)

     

    THE LINK = "?page=secure&Spage=advocates/list&letter=all&loc=$TaxID&Name=$Name"

     

    When I echo it stops at the "&" (suprisingly the %20 is ignored)

     

    ie. Abuse Counseling is the echo.

     

    I need It to echo = Abuse Counseling & Treatment (ACT).

     

    I know the "&" is causing the problem I just don't know how to fix it.

     

    Any help?

  3. I am sure there is a simple solution for this...

     

    So for I have come up with this.

     

    if(preg_match("/^[a-zA-Z][a-zA-Z -]+$/", $Name) === 0)

     

    My objective is to requrire a first name and last name.

     

    This will require a space between 2 words.

     

    John = NO

     

    JohnDoe = NO

     

    John Doe = YES

     

    Can anyone help me with this one?

     

  4. SOURCE CODE FOR FORM:

    <form  method='post' action=''>
    
    <input type='hidden' name='id[0]' value='7'>
    <input class=input type='text' name='Name[0]' value='Larry Clark'>
    <input type='hidden' name='id[1]' value='8'>
    <input class=input type='text' name='Name[1]' value='Chris Sarrett'>
    <input type='hidden' name='id[2]' value='9'>
    <input class=input type='text' name='Name[2]' value='Buck McCreary'>
    
    </form>	
    

     

    I POST THIS TO:

    $size = count($_POST['Name']);
    
    echo $size; <--------- THIS DISPLAYS IS THE NUMBER "1"
    
    $i = 0;
    
    while ($i < $size) {
    
    $Name= $_POST['Name'][$i];
    
    echo $Name; <---------  ALL THIS DISPLAYS IS THE LETTER "A"  <--WHAT"S UP WITH THAT? -->
    
    $id = $_POST['id'][$i];
    
    echo $id; <-------------  ALL THIS DISPLAYS IS THE LETTER "A"  <--WHAT"S UP WITH THAT? -->
    
    mysql_query("UPDATE coaches SET Name='$Name' WHERE id='$id' LIMIT 1");
    
    ++$i;
    }

     

    Shouldn't it show the values of the fields?

     

    I just want to update the stinking DB in one shot.

  5. Thank you for responding.

     

    <form  method='post' action=''>
    <input type='hidden' name='id[0]' value='7' />
    <tr>
    	<td widht=25% align=right>Varsity: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[0]' value='Larry Clark' /></td>
    </tr>
      <input type='hidden' name='id[1]' value='8' />
    <tr>
    	<td widht=25% align=right>Junior Varsity: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[1]' value='Chris Sarrett' /></td>
    </tr>
      <input type='hidden' name='id[2]' value='9' />
    <tr>
    	<td widht=25% align=right>Super Midgets: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[2]' value='Buck McCreary' /></td>
    </tr>
      <input type='hidden' name='id[3]' value='10' />
    <tr>
    	<td widht=25% align=right>Midgets: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[3]' value='Mark Gill' /></td>
    </tr>
      <input type='hidden' name='id[4]' value='11' />
    <tr>
    	<td widht=25% align=right>Pee Wee: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[4]' value='Robbie Lampp' /></td>
    </tr>
      <input type='hidden' name='id[5]' value='12' />
    <tr>
    	<td widht=25% align=right>Mighty Mites: </td>
    	<td width=75% align=left style='padding-left:10px'><input class=input type='text' name='Name[5]' value='Mitchel Martin' /></td>
    </tr>
      
    
    <tr>
    	<td valign=bottom height=35 align=center colspan=2><input class=submit type='submit' name='coachupdate' value='Update Coaches' /></td>
    </tr>
    </form>	

  6.  

     

    Here is the source from the form I have poulated from a DB:

    
    <form method='post' action=''>
    <input type='hidden' name='id[0]' value='1'>
    <input type='text' size='40' name='Name[0]' value='Jena Bentley'><br>
    
    <input type='hidden' name='id[1]' value='2'>
    <input type='text' size='40' name='Name[1]' value='Kerri Koblentz'><br>
    
    <input type='hidden' name='id[2]' value='3'>
    <input type='text' size='40' name='Name[2]' value='Open'><br>
    
    <input type='hidden' name='id[3]' value='4'>
    <input type='text' size='40' name='Name[3]' value='Brandi Music'><br>
    
    <input type='hidden' name='id[4]' value='5'>
    <input type='text' size='40' name='Name[4]' value='Stacey Cundiff'><br>
    
    <input type='hidden' name='id[5]' value='6'>
    <input type='text' size='40' name='Name[5]' value='Open'><br>
    
    <input type='hidden' name='id[6]' value='7'>
    <input type='text' size='40' name='Name[6]' value='Larry Clark'><br>
    
    <input type='hidden' name='id[7]' value='8'>
    <input type='text' size='40' name='Name[7]' value='Chris Sarrett'><br>
    
    <input type='hidden' name='id[8]' value='9'>
    <input type='text' size='40' name='Name[8]' value='Buck McCreary'><br>
    
    <input type='hidden' name='id[9]' value='10'>
    <input type='text' size='40' name='Name[9]' value='Mark Gill'><br>
    
    <input type='hidden' name='id[10]' value='11'>
    <input type='text' size='40' name='Name[10]' value='Robbie Lampp'><br>
    
    <input type='hidden' name='id[11]' value='12'>
    <input type='text' size='40' name='Name[11]' value='Mitchel Martin'><br>
    
    <input type='submit' name='updatecoahes' value='submit'>
    </form>
    
    
    

     

     

    I know that somewhere somehow foreach smethin  = something

    I should be able to update all this on one submit:

     

    
    if (isset($_POST['updatecoahes'])){
    
    $Name=$_post['????']
    $id_post['????']
    
    
    foreach (???????) {
    
    $query = "UPDATE coaches SET Name='$Name[$i]' WHERE id='$id[$i]' LIMIT 1";
    mysql_query($query) or die ('Error in query: $query');
    
    }
    
    }
    
    [code]
    I have read the manual and none that I can tell applies?
    
    I found the guys tutorial on books and bookinfo No Worky.
    
    Any help here?

    [/code]

  7. I am really trying to keep this as simple as possible.

     

    I have many different size images in different formats in a file and just want to display them with a max height and width.

     

    I tried CSS well... IE is IE (works great in FF).

     

    Is there a simple way?

     

  8. This is the script I'm using to upload images.  Is there something I can add to resize the image proportionaly so that is fits on the page where it is later echoed? 

     

    or

     

    Can I set a max width / height when displayed?

     

     

    function findexts ($filename) 
    { 
    $filename = strtolower($filename) ; 
    $exts = split("[/\\.]", $filename) ; 
    $n = count($exts)-1; 
    $exts = $exts[$n]; 
    return $exts; 
    } 
    
    $ext = findexts ($_FILES['uploaded']['name']) ; 
    
    $ran = rand (111111, 999999). $company ;
    
    $ran2 = $ran.".";
    
    $target = "pages/secure/partners/img/";
    
    $target = $target . $ran2.$ext;
    
    if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) 
    {
    
    mysql_query("INSERT INTO partners (id, company, url, uploaded, blurb ) 
    VALUES ('', '$company', '$url', '$target', '$blurb')");
    
    $success="<center><font color=red size=2>Upload Successful!</font><br><br></center>";
    
    }

  9. I have a form that when is completed submits the info into a DB.  No problem

     

    When the form is complete the header redirects you to a new page.  If you click the back button you of course get this page has expired but if you click yes to refresh it resubmits the same infor to the DB.  Now I have Duplicate entries with the basically the same info.

     

    How could I prevent this issue?

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.