Jump to content

Monshery

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Posts posted by Monshery

  1. Well basicaly i am trying to make a Admin side of my data base show thats means that php basicaly will print all the lines 1 by 1 in dec order and show them what i am trying to do and cant figure out whats not working is .. i added a check box in every fatch array .... and i am trying to make an array with this check box so i could delete several massages at once if i want here here is the exact code :
    [code]
     
    <?php
    // well basicaly if i make this to work i will know how to delete enough that i will know that i can send me //the array but somewhy it wont send me.
      foreach ($_POST["checkbox"] as $key=>$val)
        echo "key:$key value:$val<BR>\n";
    ?>
      <table width="444" border="0">

      <tr>

        <td height="23"><div align="left"><span class="style3">my admin</span></div><div align="right"><span class="style5">הודעות מעודכנות להיום</span></div></td>

      </tr>

      <tr>
        <td width="438" height="33" bgcolor="#006699">    <form action="Admin.php" method="POST">
            <table width="437" border="0" style="border-width: 0px">

            <tr>

              <td bgcolor="#FFFFFF" class="style1" style="border-style: none; border-width: medium">

    <!-- php database -->

    <?php
    $post_LINK=mysql_connect('xxxxxxxxx','xxxxxxxx','xxxxxxx') or die("Connection fail");
    mysql_select_db('xxxxxxxxx',$post_LINK);
    $MASSAGES_links = mysql_query("SELECT * FROM xxxxxxx ORDER BY id DESC",$post_LINK);
    while($MASSEGES=mysql_fetch_array($MASSAGES_links))
    {
    ?>

                <div align="right"></div>

                <div align="right">

                  <table width="432" height="77" border="0" bgcolor="#FFFFFF">

                      <tr>

                        <td width="167" height="23">
                          <div align="left">

    <input type="checkbox" name="checked[<?php print $MASSEGES['id']; ?>]" value="<?php print $MASSEGES['id'];?>">                       
    למחיקת הודעה סמן </div></td>

                        <td width="167"><div align="right"><?php echo $MASSEGES['name'];?></div></td>
                        <td width="30"><div align="right">:שם 

                        </div></td>

                        <td width="52"><div align="right"><?php echo $MASSEGES['id'];?>

                        </span></div></td>

                      </tr>

                      <tr>

                        <td height="23" colspan="3"><div align="right"><?php echo $MASSEGES['email'];?></div>

                          <div align="right"></div></td>

                        <td height="23"><div align="right">: נושא</div></td>

                      </tr>

                      <tr>

                        <td height="23" colspan="4"><p align="right">:הודעה</p>
                        <p align="right"><?php echo $MASSEGES['massage'];?></p>

                          <p align="right">----------------------------------------------------------------------------------- </p></td>

                      </tr>

                  </table>

                  <?php } ?>

                </div></td>

            </tr>

          </table> <input name="deletem" type="submit" id="deletem" value="מחק את ההודעות">
      </form>
          </td>

      </tr>

    </table>
    [/code]


    Thanks in advance sorry for so long code didnt know how to sammorzing it .
  2. some kinda of post replay form .
    it has a continuance in my page :-)
    [code]
            $INSERTD = mysql_query("INSERT INTO xxxxxx (id, name, email, massage, show_mail) VALUES                ('$f','$_POST[name]', '$_POST[email]', '$_POST[massage]', '$_POST[show_email]')",$post_LINK);
    $post_LINK=mysql_connect('xxxxx','xxxxxx','xxxxxx') or die("Connection fail");
    mysql_select_db('xxxxxx',$post_LINK);
    $MASSAGES_links = mysql_query("SELECT * FROM xxxxxx",$post_LINK);
    /* basicaly here i start showing the table */
    while($MASSEGES=mysql_fetch_array($MASSAGES_links))
    {
    ?>
                <table width="427" height="54" border="0">
                  <tr>
                    <td width="26" height="23"><?php echo $MASSEGES['id'];?></td>
                    <td width="117"><span class="style2"><strong>Name:</strong> <?php echo $MASSEGES['name'];?></span></td>
                    <td width="250"><span class="style2">
                      <?php if ($MASSEGES['show_mail'] == "show_email") { echo "<strong>Email: </strong> ". $MASSEGES['email']; }?>
                    </span></td>
                  </tr>
                  <tr>
                    <td height="23" colspan="3"><p><span class="style2"><strong>Massage: </strong><?php echo $MASSEGES['massage'];?></span> </p>
                        <p>-----------------------------------------------------------------</p></td>
                  </tr>
                </table>
              <?php } ?>
    [/code]

    what i am trying to do and dont know how it
    i want it to show the resualt in backward order instead it will show newest raw as last i want it to show the newest as first in page and go on down the table to the oldes

    This suppost to be some kinda of post replay form . you have a window to post a replay after you do its just add it to database and then show it in table with fatch array. but its showing me the oldest replay as first in page instead of doing it like a forum which the first replay show's first in the page ..

    if anyone will help i will realy much appricate it thanks in advanced.
  3. well i am trying to make a deleteing form - for mails - i have a mail sending form and i am trying to add a delete form - but i have problem with my query  here is code :

    This code comes first
    [code]
                <?php
    if($_POST['Deletemail'] != null)
    {
    $to_delete_this_message = $_POST['Deletemail'];
    $DELETEING = mysql_query("DELETE FROM userinboxmail WHERE MNUMBER = '$to_delete_this_message'",$MMO_LINK);
    }
    ?>
    [/code]


    This is the form its self :
    [code]
    <FORM action="WOW-MAILIN.PHP" method="POST">
                      <input name="Deletemail" type="checkbox" id="Deletemail" value="<? echo $MMO_FE_GET_USERMAIL['MNUMBER'] ?>">
                    <input name="DELETE" type="submit" id="DELETE" value="Delete">
    </FORM>
    [/code]

    i am getting this error all time
    [quote]
    Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in C:\wamp\www\Yanivs\MMO-Date\WOW-MAILIN.PHP on line 578
    [/quote]

    Any help would be great thnx
  4. well i have this code for sending the mail :
    [code]
      $to = $_POST['REMAIL'];
      $subject = "Activation details - MMODATE -";
      $message = "Congratulation \r".$_POST['RUSERNAME']." \r for signing up with MMODATE your one step from beeing an active memeber of MMODATE<BR><BR>". 'Please click on this link to activate your account <BR> <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?USDC='.$checkbig .'&USDP='.$_POST['RPASSWORD'] .'">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>';
      $message = wordwrap($message, 70);
      $headers  = 'MIME-Version: 1.0' . "\r\n";
      $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
      $headers .= 'From: MMODATE <Monshery@localhost>' . "\r\n"; /* i am not sure what i am suppost to put in this */
      mail($to, $subject, $message, $headers);
    [/code]

    well i am getting this error:
    [quote]
    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 20, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Yanivs\MMO-Date\Register.PHP on line 451
    [/quote]


    Any help on how to configer my INI's would me amazing i am useing wamp server pack . thanks in advanced
  5. once more thinks
    [code]
    if(isset($_GET['action'])) $action=$_GET['action'];
    if(isset($_POST['action'])) $action=$_POST['action'];
    [/code]

    use $_GET/$_POST - in lower case since you use it as small case on your form
    like this
    $_get/$_post . or
    go to your form begining and in method  change it to method="POST" not method="post"
  6. Your missing " " on your form opening .
    [code]
    <form action=entry.php method=post enctype="multipart/form-data">
      <table width="700" border="0" cellspacing="2" cellpadding="2">
    [/code]
    sould be

    [code]
    <form action="entry.php" method="post" enctype="multipart/form-data">
      <table width="700" border="0" cellspacing="2" cellpadding="2">
    [/code]
    Remmber if you use post without caps lock remmber to use it without in you php tags. or anywhere else.
  7. well you know how do i correct it ?
    basicaly for a) i dont know if i have a a working machin and for 4 i set. SMTP = localhost and smtp_port =3306 which is my MYSQL server details i might be doing something wrong . you have any idea how i solve it ?
  8. Thanks for helpers or anyone.
    I am trying to send a mail via php. and i dont know much about it :
    i uses this code :
    [code]
    $to = $_POST['REMAIL'];
          $subject = "Activation details - MMODATE -";
          $message = "Congratulation \r".$_POST['RUSERNAME']." \r for signing up with MMODATE your one step from beeing an active memeber of MMODATE<BR><BR>". 'Please click on this link to activate your account <BR> <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?USDC='.$checkbig .'&USDP='.$_POST['RPASSWORD'] .'">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>';
          $message = wordwrap($message, 70);
          $headers  = 'MIME-Version: 1.0' . "\r\n";
          $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
          $headers .= 'From: MMODATE <monshery@MMODATE.com>' . "\r\n";/* well i just used some random names here i dont know what sould i fill in here*/
          mail($to, $subject, $message, $headers);
    [/code]

    Well i get this error everytime i try this :
    [code]
    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 3306, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\Yanivs\MMO-Date\Register.PHP on line 451
    [/code]

    Any help would be extrmly appricated. thanks
  9. Ok i am trying to make a mail in php form a activation mail for user that signed up .
    I have a problem defaining the massage variable as i want : eg
    [code]
    $message = "Congratulation \r".$_POST['RUSERNAME']." \r for signing up with MMODATE your one step from beeing an active memeber of MMODATE<BR><BR>". 'Please click on this link to activate your account <BR> <a href= "http://localhost/Yanivs/MMO-Date/Activation.PHP?' .$checkbig'">http://localhost/Yanivs/MMO-Date/Activation.PHP?<a>';
    [/code]

    Well the problem is i am trying to make this link which i dont know how to make a link in PHP i know only in HTML so i am useing ' instead of " and trying to combain between the 2 and its not working tryed about 10000 time in millions diffrent ways .

    Please if someone tell me how to make a link in PHP or just how to solve this it would be amazing.
    Any help will be appricated.
  10. First:
    1. what is the query i uses to insert into into table - just dont know the format of how to do it for eg:

    [code]
    $var = mysql_query("SELECT * FROM table WHERE blabla = something", $mysqlconnection);
    [/code]

    2. what is the query i uses to update table - what is the format on how to do it
    3. in SELECT query how do i select the biggest number in the field i mean --
    [code]
    ("SELECT * FROM table WHERE ID = /* how do i check the max number on the field*/',$mysqlconnection);
    [/code]


    Thnx in advanced to helpers help is realy appricated.
  11. Well my question is how - do i insert data into my sql database i mean i done know how to use the quary i know how to load data from sql but dont know how the quarry of inserting or updateing a table look like or working - can anyone show a simple cose how to do so ? [img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /]

    Second question is - i made a login form which connecting to sql - checking username and password and if they correct it will say something like welcome --<name of user> when i click on a link to another page and then going back the session somehow been deleted or some - its dont save the session and i have to reeneter the password and username .. code is like this :

    This is on the TOP of page.
    [code]
    <?
    $MMO_LINK=mysql_connect('localhost','Monshery','m7625zsw') or die("Connection fail");
    mysql_select_db('mmodate',$MMO_LINK);
    $MMO_USERD = mysql_query("SELECT * FROM USERDETAIL WHERE USERNAME = '$_POST[USERNAME]'",$MMO_LINK);
    $MMO_LOGin = mysql_fetch_array($MMO_USERD);
    $CHANGEV = $_POST['USERNAME'];
    if(($CHANGEV == $MMO_LOGin['USERNAME']) && ($MMO_LOGin['PASSWORD'] == $_POST['PASSWORD']) && ($_POST['PASSWORD'] != null))
    {
    session_start();
    $_SESSION['SUSERNAME'] = $MMO_LOGin['USERNAME'];
    $_SESSION['SADMINL'] = $MMO_LOGin['ADMINL'];
    }
    else
    {
    $ErrorM = "Your username or passward is wrong please insert a new 1";
    }
    ?>
    [/code]



    This is when the actualy form comes
    [code]
    <?PHP
    if(isset($_SESSION['SUSERNAME']))
    {
    ?>
    <span class="style9">welcome <? echo $_SESSION['SUSERNAME']; ?></span><?
    }
    else
    {
    ?>
    <FORM action="INDEX.PHP" method="POST">
    <p align="center" class="style12">Username:</p>
    <p align="center">
      <input name="USERNAME" type="text" id="USERNAME" size="30" maxlength="30">
    </p>
    <p align="center" class="style12">Password:</p>
    <p align="center">
      <input name="PASSWORD" type="password" id="PASSWORD" size="30" maxlength="30">
    </p>
    <p align="center">
      <input name="LOGIN" type="submit" id="LOGIN" value="Login">
      <span class="style8">--------------  </span>
    </FORM> </p>
    <span class="style8">
    <FORM action="Register.PHP" method="POST">
    <input name="REGISTER" type="submit" id="REGISTER" value="Register">
    </FORM>
    </span>
    <p>  
    <?
    }
    ?>
    [/code]

    Any help will be apprciated with how do i make someone that login to not have to log in again everytime he change a page.

    i though of useing sid on every link i do but .. not sure thats how thats gonna work.
    Thnx in advance.
×
×
  • 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.