Jump to content

cearlp

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

cearlp's Achievements

Member

Member (2/5)

0

Reputation

  1. Thanks all for the replies.
  2. Is an error obvious in the following code. It worked okay until just recently. Could a Ubuntu update to 22.04 have changed something i neew to change in the PHP coding? body { font-family: Georgia, "Times New Roman", Times, serif; color: maroon; background-color: #daa520 } h2 { padding-left: 8em } p { font-size: 13.5pt; text-indent: 5em } a:link { color:blue; text-decoration: none } a:visited { color:purple; text-decoration: none } </style> <script language=javascript> function Validate() { if (document.form1.password.value == "fredpeabody") { window.location="<?php echo 'sxdisp.php'; ?>"; return(false); } else { window.location="<?php echo 'sxdispunprotect.php'; ?>"; return(false); } } </script> </head> <body onLoad="self.focus();document.form1.password.focus()" > <div id="main-content"> <p> Enter the Password to search and display all the information on the Sigma Database. </p> <p> Otherwise only the unprotected information will be displayed.</p> <form name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']?>" onsubmit="return Validate()"> <table width="1000" border="0" cellspacing="1" cellpading="0"> <tr> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td align="right">Password: </td> <td><input size="20" maxlength="20" name="password" value=" "> </td> </tr> </table> </form> </div> </body>
  3. Thank you mac_gyver... Finding out the errors showed me that it was a connection to the database that failed due to a password change that was not accounted for in the code.
  4. I tried the following after researching mysqli exceptions and the result was the same,,,first two echos are displayed, no error printout but the echo "after conn" was not displayed. function conn($sql) { $host = "localhost"; $user = "root"; $pass = "xxx"; valid root password for database $db = "xxx"; looking at database with PHPMYADMIN seems okay echo "in conn--- "; echo "HOST $host, USER $user, PASS $pass, DB $db"; $con = new mysqli($host, $user, $pass, $db); if ($con->connect_errno) { printf("connect failed: %s\n" , $con->connect_error()); exit(); } echo "after conn"; }
  5. No error or any message. The program seems to finish normally except nothing was available to be displayed from the database. The code: if (!($conn=mysqli_connect($host, $user, $psss, &db))) { printf("error connecting to DB by user = $user"); exit; }
  6. After years of working, the call to mysql_connect does nothing. Software installed is: Server: Localhost via UNIX socket Server type: MariaDB Server version: 10.6.18-MAriaDB-0ubuntu0.22.04.1 Protocol version: 10 Apache/2.4.52 (Ubuntu) Database client version: libmysql - mysqlind 8.1.2-1ubuntu2.18 PHP extension: mysqli curl mbstring PHP version: 8.1.2-1ubuntu2.18 What have I missed, some update or could the database be corrupted?
  7. My BAD! The code is mysqli_error() not mysql_errno(). BUT, adding the $conn to the mysqli_error($conn) produces a valid and informative error message. Many thanks for the help.
  8. Two identical php programs doing a mysqli_query, but on different databases. One succeeds and the other fails. The one that fails returns no errno. Could the cause be the databases? If so, what could be the problem? They are real similar in construction, one has more fields than the other, but almost the same data in both. $conn = use, passwd, database $sql = insert into members (name,addr,city,state) values('Joe','123 St','Somecity','CA') $result = mysqli_query($conn, $sql) or die (Can't run query because " . mysql_errno());
  9. Thanks, I will post to the javascript forum.
  10. I wasn't looking at it that way. My flow is like this: As stated, the function is in the <head> section of the file. A form is displayed and if the submit button is selected the page reloads itself. If isset($_POST['submit'] is true certain fields are checked for being blank. If they are, an alert box is displayed and the form is re-displayed with the data that has already been filled in. If the fields are not blank processing continues and later in the process flow a database is going to be updated. At this point I want to call a confirm function to display a confirm box and need the response of either OK or Cancel to either continue the update or re-display the form. Does this make sense?
  11. I define a Javascript in the <head> section of a .php file and call it from the <body> section with the following: echo "<script language='javascript'>function();</script>". The function displays a confirm box with the normal Cancel and OK buttons just fine, but I want to capture the function return of true or false for which button was selected. So far I haven't found a way to get return a value from the function. Any ideas???
  12. Thanks for the help Crayon Violent. I can get by be calling the script with onsubmit but can a javascript be called from anywhere in a php script?
  13. I have a php script that creates an HTML form and then gets input from the submission of that form. Is it possible for the php script to display some sort of confirmation request and then receive input from the keyboard in response to the request before processing the data that was input via the form? I hope this question make sense? Thanks in advance.
  14. Responding to the two previous replies --- A port checker shows on;y port 80 as being active (naturally since I am using http to run the port checker ) and I know sendmail.dll is not a mailserver but I thought since I only have Outlook Express as a mail program (it's never used though it is installed) it might be using sendmail.dll and tying up port 25.
  15. I am running XP so I have a sendmail.dll but I don't know if anything else is using port 25. Is there a way to out?
×
×
  • 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.