Jump to content

sseeley

Members
  • Posts

    85
  • Joined

  • Last visited

Everything posted by sseeley

  1. I am trying to validate a check box, but my return always just come back with 'on'. Can anyone help me? <head> <script> <!-- function validate() { var deleted=document.getElementById("del").value alert(deleted); } --> </script> </head> <?php echo "<form action=\"test1.php\" method=\"POST\" name=\"paymentsForm\" onsubmit=\"return validate()\">"; echo "<input type=\"checkbox\" name=\"deleted\" id=\"del\"></td>"; echo "<input type = \"submit\">"; echo "</form>"; ?> Many thanks in advance
  2. I have mailed my server admin, but I was seeing if anyone here would know the solution. I do not know of any other way of sending my data between pages so thats why I am using posts and sessions. I am not a very proficient programmer.
  3. Why does my hosted server only post 200 records, but my local server on my PC will post 10,000 records? Is there a setting I can change?
  4. I am running this code... <?php session_start(); $i=0; $h=500; $_SESSION['h'] = $h; echo "<form action=\"test2.php\" method=\"POST\" name=\"test1\">"; while ($i <= $h) { $postID = "post" . $i; $postValue = "postValue" . $i; echo $postID. " - "; echo "<input type=\"text\" name=$postID id=$postID value=$postValue>"; echo "<br/>"; $i++; } echo "<input type=submit value=\"submit\">"; echo "</form>"; ?> This posts to this page... <?php session_start(); $i = 0; echo $_SESSION['h']; echo "<br/>"; while ($i <= $_SESSION['h']) { $postID = $_POST['post' . $i]; echo $i. " - " . $postID; echo "<br/>"; $i++; } ?> However only the first 200 records are posted on my server. On my test system it works fine, can anyone tell me which setting I can adjust on my server? Many thanks in advance.
  5. I have a list of around 115 users, each has a select box of 4 options. Onces the options are selected these post to a second page to update the database. The first 100 posts are transfered to the second page, however all the records past 100, eg 101, 102 etc do not pass their details. postID is incremented automatically dependant upon the number of users within the system. echo $_POST['postID99']; This comes through all okay, but echo $_POST['postID100']; does not come through... If anyone can explain or help me I would be grateful. Regards Stuart echo "<input type=\"hidden\" name=$postID id=$postID value=$userID>";
  6. I have a date that I recieve as a post an example being $date = "01/04/1977". I need to add one day onto this date, can anyone help me with this? I also need to be able to look up the day of the week for this date? Is this possible? Many thanks in advance. Stuart
  7. I could be getting confused, but here is the form I create with multiple rows. Each row has two posts, ID, and then the rank value. echo "<form action=\"updateRanks.php\" method=\"POST\" name=\"updateRanks\">"; echo "<table class=\"reportsTitleStyle\" border=\"1\">"; echo "<tr>"; echo "<td align=\"left\" height=\"20px\" width=\"50px\" style=\"font-family:arial; font-weight:bold; font-size:10px; text-color:black;\">"; echo "rank"; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"100px\" style=\"font-family:arial; font-weight:bold; font-size:10px; text-color:black;\">"; echo "last name"; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"100px\" style=\"font-family:arial; font-weight:bold; font-size:10px; text-color:black;\">"; echo "first name"; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"170px\" style=\"font-family:arial; font-weight:bold; font-size:10px; text-color:black;\">"; echo "new rank"; echo "</td>"; echo "<tr>"; echo "</table>"; echo "<table class=\"reportsTitleStyle\" border=\"1\">"; while ($i < $num_results) { $userID = mysql_result($getCadetDetails,$i,"tbluser.pkUserID"); $rank = mysql_result($getCadetDetails,$i,"tblranks.fkCadetRankID"); $getRankDescription = mysql_query( " SELECT shortDescription FROM tblcadetranks WHERE pkCadetRankID = $rank " ) or die(mysql_error()); $lastName = mysql_result($getCadetDetails,$i,"tbluser.lastName"); $firstName = mysql_result($getCadetDetails,$i,"tbluser.firstName"); $rankName = mysql_result($getRankDescription,0,"shortDescription"); echo "<tr>"; echo "<td align=\"left\" height=\"20px\" width=\"50px\" style=\"font-family:arial; font-weight:normal; font-size:10px; text-color:black;\">"; $postID = $post . $i; echo "<input type=\"input\" name=$postID id=$postID value=$userID>"; echo $rankName; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"100px\" style=\"font-family:arial; font-weight:normal; font-size:10px; text-color:black;\">"; echo $lastName; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"100px\" style=\"font-family:arial; font-weight:normal; font-size:10px; text-color:black;\">"; echo $firstName; echo "</td>"; echo "<td align=\"left\" height=\"20px\" width=\"170px\" style=\"font-family:arial; font-weight:normal; font-size:10px; text-color:black;\">"; echo "<select name =$pkUserID size=\"1\">"; $getAllRanks = mysql_query( " SELECT pkCadetRankID, description FROM tblcadetranks ORDER BY rankPriority DESC " ) or die(mysql_error()); $num_results1 = mysql_num_rows($getAllRanks); $ii = 0; while ($ii < $num_results1) { $rankID = mysql_result($getAllRanks,$ii,"pkCadetRankID"); if ($rank == $rankID) { $rankDescription = mysql_result($getAllRanks,$ii,"description"); echo "<option value=$rankID selected=\"selected\">$rankDescription</option>"; } else if ($rank != $rankID) { $rankDescription = mysql_result($getAllRanks,$ii,"description"); echo "<option value=$rankID>$rankDescription</option>"; } $ii++; } echo "</select>"; echo "</td>"; echo "</tr>"; $i++; } echo "<tr>"; echo "<td align =\"right\" colspan =\"4\">"; echo "<input type=submit value=\"update ranks\">"; echo "</td>"; This creats me a page with all the POST value. On submit I need to post to another page. Could anyone help me with an example for how I can vary the $_POST variable on the second page. I am currently unfamiliar with arrays, and am not exactly sure if they are the right things to use. Many thanks in advance. Stuart
  8. Ah never used an array... Any coding examples you could help me with?
  9. Yes I need to increment $_POST['post']
  10. Is there a way I can make x a variable in the following code? $POST1 = $_POST[postx]; I need to make x 1, 2, 3, 4 etc... Many thanks in advance for your help. Stuart Seeley
  11. I have about 100 records within my database, each record has a job title from 5 possible job titles. I have listed using PHP every row with a unique ID and a dropdown list for the job titles at the end of the row. I want to be able to update a number a rows, not in any order. When I use an update button I want to send via POST all the ID's and drop down selections. I have managed to automate the post id's i.e. POST1, POST2, POST3. My problem is on the POST page where I want to do the database query, I need to automate the following $POST1 = $_POST[postx]; How can I make the x a variable? Many thanks in advance Stuart Seeley
  12. I have a number of records to post and update, around 100 at a time. I have all the records selected and reported back. I am running this code to increment the $_POST value $postID = $post . $i; echo "<input type=\"input\" name=$postID id=$postID value=$userID>"; When the records are posted I then need to work with this code, but I am unsure how to increment the $_POST['postID']? I hope someone can help me. Many thanks in advance...
  13. Can anyone help me with this code. I am just trying to centre the line of text, and set it 50px from the top of the screen? <style> #menuBar { display: block; width: 50%; margin-left: auto; margin-right: auto; } </style> <body> <div id="menuBar">Your content here</div> Thanks
  14. sseeley

    CSS Center

    Thanks Ken, did not work unfortuantly...
  15. sseeley

    CSS Center

    I am trying to create a CSS menu bar, I have been using the 'position:absolute;' and then specifying the x and y to place the object. However I really would like to just have the bar center on the webpage but I cannot find out how to do it. Can anyone help me at all? Many thanks in advance
  16. I am trying to create a CSS menu bar, I have been using the 'position:absolute;' and then specifying the x and y to place the object. However I really would like to just have the bar center on the webpage but I cannot find out how to do it. Can anyone help me at all? Many thanks in advance
  17. Hi I currently have all my records within my database encrypted for data protection etc...when I retrieve these records, I cannot sort them A-Z using MYSQL as I do not decrypt them until they are displayed. Is there an easy way of sorting records within PHP to allow me to display them in alphabetical order? Many thanks in advance.
  18. Thanks, but I cannot get this to work, I tried the following... With a 'public function' I get this error Parse error: syntax error, unexpected T_PUBLIC in C:\server\www\myserver.dev\public_html\accounts\test.php on line 3 If I remove the 'public' nothing returns at all? <?php $aDateParts = "01-04-1977"; function ParseDateToMysql($Stamp) { $aDateParts = explode("-", $Stamp); if(count($aDateParts) != 3) { return "0000-00-00 00:00:00"; } else { return date("Y-m-d H:i:s",mktime(0, 0, 0, $aDateParts[1], $aDateParts[0], $aDateParts[2])); } } ?> Would someone be able to explain further how this works, sorry really new at this PHP...
  19. I want to convert a standard date into a MYSQL date...
  20. Hi I am hoping someone can help me...a user fills in their date of birth for example, 22-01-2005 This is then posted to another form...as shown in the code $date_of_birth = $_POST['date_of_birth']; echo $date_of_birth; $date_of_birth_mysql = date("Y-m-d",strtotime($date_of_birth)); echo $date_of_birth_mysql; When it is then converted to a mysql date it appears as follows? These are the two strings echoed... 22-01-2005 2027-06-28 Can anyone help as to why this code is doing this? Many thanks
  21. Hoping someone can help. I am trying to post the following to a hotmail email account, but it just shows the HTML code, and will not display the email as I would like. Can anyone provide some advice? $to = $email_nonCrypt; $headers = 'From: accountsadmin@1083squadron.co.uk'; $subject = "New User Account"; $body = "<html><body><p style=\"font-family:arial; font-weight:normal; font-stretch:wider; font-size:14px; color:black;\">Welcome to 1083 accounts. Your new account has been created.<br/><br/>Your username is: " . $userName_nonEncrypt . "<br/>Your password is: " . $password . "<br/><br/>Please use the following link to log into the accounts system <a href=\"http://accounts.1083squadron.co.uk\">http://accounts.1083squadron.co.uk</a></p></body></html>"; echo $to . "<br/>"; echo $headers . "<br/>"; echo $subject . "<br/>"; echo $body . "<br/>"; mail($to, $subject, $body, $headers); Stuart
  22. I am looking for some help, and I would be really grateful if anyone can help me out... The code I am using is... $get=mysql_query("SELECT count(*) FROM tbluser WHERE `username` = '$userName' AND `password` = '$protectedPass' AND `deleted` = '0' "); $result = mysql_result($get,0); echo $result; But I keep getting the following error? Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/mypcguy2/public_html/accounts/loginConfirm.php on line 12 It's only happening on my live server and not my local test server? Can anyone help me...many thanks in advance. Stuart
  23. I am trying to insert an encrypted line into MYSQL. However each time I try I get an error. I am using $updateDataRow=mysql_query(" UPDATE tbluser SET `firstName` = '$encryptedFirstName' "); However the encrypted string contains a ' therefore I am getting the following error : 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'N(« íwÊ픦÷Ýøª<"˜©ÙÀ'' at line 1' The encryped string is as follows... '™–w> ‚©'N(« íwÊ픦÷Ýøª<"˜©ÙÀ' Can anyone help me? Many thanks in advance. Stuart
  24. Can anyone help me? I am trying to install a MCRYPT to allow me to develop locally on my PC. If anyone can help me with a simple guide I would be grateful. Thanks in advance
  25. Hi I am hoping someone can help me. I need to insert a string as the default value in a form? I cannot get it to work at the moment? The example I am wokring with is below. $userID = "test"; echo "<tr>"; echo "<td align=\"right\" height=\"10px\" width=\"100px\" style=\"font-family:arial; font-weight:normal; font-stretch:wider; font-size:11px; text-color:black;\">id</td><td><input type=\"text\" name=\"id\" size=\"7\" disabled value=$userID></td>"; echo "</tr>"; Many thanks in advance. Stuart
×
×
  • 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.