Jump to content

Search the Community

Showing results for tags 'not'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 7 results

  1. My error codes are not working , i declared them as follow if(isset($_POST['login_submit'])){ $query = mysql_query("SELECT id FROM users WHERE login_email = '". $_POST['login_email'] ."'") or die(mysql_error()); $email_check = mysql_num_rows($query); $email_check_data = mysql_fetch_array($query); if(empty($_POST['login_email']) || empty($_POST['login_password'])){ echo "<div class=\"notification warning\"> Please fill in all the fields below </div>"; } elseif($email_check == 0) { echo "<div class=\"notification error\"> Email address or password . Please check your email! </div>"; is there anything wrong ? If the fields are empty or i input no email or password no erros displayed
  2. Hello I got a question , Im trying to add balance after each transaction ,what I tried to do is to echo $account Balance and then use function to deduct the row amount Im really confused and can't figure it out how i would i achieve such thing : The code I've used <td>£ <?php echo number_format ($account['balance'] + $row['amount'], 2); ?></td>
  3. hi ive been trying to sort this out all day, im very inexperianced in php but really want to do well in it and at the moment ive got a table working linked to a database and which pulls records but now i want to get an update and delete button but i cant seem to hack it heres the code. <?php $con = mysqli_connect("localhost","root","","lcm"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } //updates table. if (isset($_POST['update'])){; $UpdateQuery = "UPDATE tbl_contactinfo SET Name='$_POST[Name]', Address='$_POST[Address]' WHERE Name='$_POST[hidden]'"; mysql_query($UpdateQuery, $con); } if (isset($_POST['delete'])){; $DeleteQuery = "DELETE FROM tbl_contactinfo WHERE Name='$_POST[hidden]'"; mysql_query($DeleteQuery, $con); } //selects the table. $sql = "Select * from tbl_contactinfo"; if ($result = mysqli_query($con, $sql)) { echo "<table border='1'> <tr> <th>Name</th> <th>Address</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo '<form action="index1.php" method="post">'; echo '<tr>'; echo '<td><input type="text" name="name" value="' . $row['Name'] . '" /></td>'; echo '<td><input type="text" name="address" value="' . $row['Address'] . '" /></td>'; echo '<td><input type="hidden" name="hidden" value="' . $row['ID'] . '" /></td>'; echo '<td><input type="submit" name="update" value="update" /></td>'; echo '<td><input type="submit" name="delete" value="delete" /></td>'; echo '</tr>'; echo '</form>'; } echo "</table>"; } ?> <html> <body> <form action="insert.php" method="post"> Name: <input type="text" name="Name"> Address: <input type="text" name="Address"> <input type="submit"> </form> </body> </html> and error messages ive been getting. ( ! ) Notice: Undefined index: Name in C:\wamp\www\Index1.php on line 12 Call Stack # Time Memory Function Location 1 0.0000 147208 {main}( ) ..\Index1.php:0 ( ! ) Notice: Undefined index: Address in C:\wamp\www\Index1.php on line 12 Call Stack # Time Memory Function Location 1 0.0000 147208 {main}( ) ..\Index1.php:0 ( ! ) Warning: mysql_query() expects parameter 2 to be resource, object given in C:\wamp\www\Index1.php on line 13 Call Stack # Time Memory Function Location 1 0.0000 147208 {main}( ) ..\Index1.php:0 2 0.1562 154608 mysql_query ( ) ..\Index1.php:13 these are for update and for delete ( ! ) Warning: mysql_query() expects parameter 2 to be resource, object given in C:\wamp\www\Index1.php on line 18 Call Stack # Time Memory Function Location 1 0.0000 147208 {main}( ) ..\Index1.php:0 2 0.1406 154456 mysql_query ( ) ..\Index1.php:18 ive stoped the error messages before dont no how i did it but they wernt showing, only problem is when i pressed them nothing happened any help will be great.
  4. Hello, I have piece of code I have written that, when the form is submitted it sends the string from the textbox through ajax, through a database and returns a name corresponding to that string. It works fine in chrome but not in firefox and I was wondering if you could help. If I set the function to a simple alert(code) it will fire it and work fine however when I revert it to the ajax script it simply reloads the page with the "?code=string" and ignores anything and everything in the js function. This is the ajax code: function signin(code) { // event.preventDefault(); var xmlhttp; var photo; if (code=="") { document.getElementById("resultcontents").innerHTML="lol"; return; } if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { var str = xmlhttp.responseText; var split = str.split(", "); document.getElementById("resultcontents").innerHTML=split['0']; document.getElementById("counter").innerHTML=split['1']; if(!(split['2'] == undefined)){ document.getElementById("webcamcanvas").innerHTML="<img src='" +split['2']+"' width='400' height='300'>"; } document.getElementById("codetextbox").value=""; document.getElementById("codetextbox").focus(); } } xmlhttp.open("GET","files/******.php?code="+code,true); xmlhttp.send(); } This is the HTML form: form onsubmit="signin(codeform.codetextbox.value)" name="codeform"> <input type="textbox" name="codetextbox" id="codetextbox" /> </form> The reason it has no submit button is because firstly, it clutters up the page and secondly I'm using a barcode scanner which automatically inserts a carriage return, submitting the form. Any help would be greatly appreciated! Also, I'm sorry if this is in the wrong section, it's to do with both JS and Ajax and I didn't know which to choose. Jacbey.
  5. Hello. I have a quick question (it's probably easy to solve): why isn't the below code working? <?php $myFile = "testFile.txt"; $fh = fopen($myFile, 'w+'); $theData = fread($fh, 5); fclose($fh); echo $theData; ?> All I get is a blank page. Nothing is displayed, and I'm not sure what to do.
  6. Hi guys, Been a while since I posted on the forums (if at all). Have an issue that's been biting me for about two days. It's probably staring me in the face though. I can display data from MySQL with PHP on the page just fine. However, updating the database via a form is just not happening. The form just reverts to display the data that was manually entered into the database or the database table is emptied upon submit. Here is the PHP being used to retrieve and update: // Update Database Tables $result = mysql_query("UPDATE `dev_cms`.`settings` SET `site_name` = '$site_name', `site_slogan` = '$site_slogan', `admin_email` = '$admin_email', `facebook` = '$facebook', `twitter` = '$twitter', `tos` = '$tos' WHERE `settings`.`id` =1;"); // Retrieve all the data from the "example" table $result = mysql_query("SELECT * FROM settings") or die(mysql_error()); // store the record of the settings table into $row $row = mysql_fetch_array( $result ); The form: <form action="settings.php" method="post"> <table class="listing form" cellpadding="0" cellspacing="0"> <tr> <th class="full" colspan="2">General Settings</th> </tr> <tr> <td width="172"><strong>Site Name</strong></td> <td><input type="text" name="site_name" class="text" value="<?php echo $row['site_name']; ?>"/> <i>Your website Name</i></td> </tr> <tr> <td><strong>Site Slogan</strong></td> <td><input type="text" name="site_slogan" class="text" value="<?php echo $row['site_slogan']; ?>"/> <i>A catchy slogan</i></td> </tr> <tr> <td><strong>Admin Email</strong></td> <td><input type="text" name="admin_email" class="text" value="<?php echo $row['admin_email']; ?>"/> <i>For outgoing email</i></td> </tr> <tr> <td><strong>Facebook Page</strong></td> <td><input type="text" name="facebook" class="text" value="<?php echo $row['facebook']; ?>"/> <i>Your Facebook address</i></td> </tr> <tr> <td><strong>Twitter ID</strong></td> <td><input type="text" name="twitter" class="text" value="<?php echo $row['twitter']; ?>"/> <i>Your Twitter ID</i></td> </tr> <tr> <td><strong>Terms of Service</strong></td> <td><textarea name="tos" border="0" cols="45" rows="5"><?php echo $row['tos']; ?> </textarea><i>Terms and Conditions</i></td> </tr> <tr> <td> <label> <input type="submit" name="Submit" value="Save" /> </label></td> </tr> </table> </form> If anyone could please, without too much Jargon, have a look and point me in the right direction I would greatly appreciate it. Thanks in advance.
  7. Hello Everyone. Till now I used to work on XAMPP and WAMP but today I tried installing Apache,PHP,and MySQL seperately(MAnually). For that I downloaded Apache(httpd-2.0.64-win32-x86-openssl-0.9.8o.msi), PHP(php-5.3.17-Win32-VC9-x86.msi) MySQL(mysql-5.5.28-win32.msi). First I installed Apache.Everything went right and on opening http://localhost it said that apache is correctly installed on your pc. Then I installed PHP.While installing,it asked for httpd.conf file so I provided it and everything went fine. Then I created a file named phpinfo.php in htdocs folder and wrote the following code in it <?php phpinfo(); ?> But when I opened the url http://localhost/phpinfo.php it is showing the following error. Please hefp me out.Unable to solve it.
×
×
  • 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.