jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
Stop using mysql_*, start to learn MySQLi or PDO. Ok, moving on....I've rewritten a little your get.php file. <?php error_reporting(-1); $conn = mysql_connect('localhost', 'jazzman', 'password', 3306) or die(mysql_error()); $db_name = mysql_select_db('test', $conn) or die(mysql_error()); $img = $_FILES["pictu"]["name"]; $imgTitle = $_POST['title']; if (!empty($img)) { $imgName = $_FILES["pictu"]["name"]; $deuce = "upload/" . $imgName; if (move_uploaded_file($_FILES['pictu']['tmp_name'], $deuce)) { $sql = sprintf("INSERT INTO media (`Name`, `pic`) VALUES('%s','%s')", mysql_real_escape_string($imgTitle), mysql_real_escape_string($imgName)); $result = mysql_query($sql) or die(mysql_error()); printf("Inserted records: %d\n", mysql_affected_rows()); mysql_close($conn); } else { echo 'Moving file upload failed!'; exit; } } ?>
-
How did you solve the issue? I know how to do this, but the principle of that forum is to share solutions to each other.
-
Problem connecting (or inserting in MySQL?): Connection closed gracefully
jazzman1 replied to firlefanz's topic in MySQL Help
Why did you post this topic to the php regex section? Go to the control panel providing you from your web hosting provider and obtain details about your database configuration. -
Check again the Psycho's script. $output .= " implode("<br>\n", $users); it's not the same to: $output .= " implode('<br>\n', $users);
-
Where is located "localhost/DispatchReports/DispatchReportsFolder" on the root web server directory or somewhere else on the system?
-
mail() header to prevent mail going straight to junk
jazzman1 replied to popcop's topic in PHP Coding Help
Where do you host the web application or you're using the own home machine for a server? -
@PHP_CHILD, how to you expect investigating your scripts for Javascript errors without using some JS debugger tools? If you're using Mozilla Firefox, I strongly recommend you to check the documentation of firebug, it's a really very powerful debugging javascript tool - http://getfirebug.com/ Anyway, moving on.....why did you try to mix up jquery and core Javascript? I rewrote your script and it seems work to me. 1. index.html <html> <script src="http://code.jquery.com/jquery-latest.js"></script> <script type="text/javascript"> $(document).ready(function(){ $.ajax({ url:"css/style.css", success:function(data){ $("<style type=text/css>").appendTo("head").html(data); } }) }); function createObject() { var request_type; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ request_type = new ActiveXObject("Microsoft.XMLHTTP"); }else{ request_type = new XMLHttpRequest(); } return request_type; } var http = createObject() /* -------------------------- */ /* LOGIN */ /* -------------------------- */ /* Required: var nocache is a random number to add to request. This value solve an Internet Explorer cache issue */ var nocache = 0; function login() { // Optional: Show a waiting message in the layer with ID ajax_response document.getElementById('login_response').innerHTML = "Loading..." // Required: verify that all fileds is not empty. Use encodeURI() to solve some issues about character encoding. var username= encodeURI(document.getElementById('username').value); var password = encodeURI(document.getElementById('password').value); // Set te random number to add to URL request nocache = Math.random(); // Pass the login variables like URL variable http.open('get', '/login.php?username='+username+'&password='+password+'&nocache = '+nocache); http.onreadystatechange = loginReply; http.send(null); } function loginReply() { if(http.readyState == 4){ var response = http.responseText; if(response == 0){ alert('Login failed! Verify user and password'); } else { alert('Welcome'+response); window.location='home.php'; } } } function forgot() { document.getElementById('login_blue_hdr').innerHTML = "done.." } </script> </head> <body> <span>I have nothing more to say... </span> <div id="foo">FOO! </div> </body> </html> 2. style.css /* Document : style Created on : Feb 13, 2013, 7:13:08 AM Author : jazzman Description: Purpose of the stylesheet follows. */ /* TODO customize this sample style Syntax recommendation http://www.w3.org/TR/REC-CSS2/ */ div#foo { background-color: yellow; }
-
What debugging steps have you taken so far, so I see many places which could go wrong. Which tools do you use to debug Javascript?
-
// Again, never trust user input! $user = $sql->real_escape_string($_POST['username']); $query = "SELECT id, password, username, UNIX_TIMESTAMP(created) AS salt FROM users WHERE username = '{$user}'";
-
Congrats my friend
-
Well, I'm now officially Canadian God bless Canada, jazz.... http://canada.lesno....nadaCitizen.jpg
-
Try to update the firmware on the router. Before do this read the manual.
-
What's the model of the laptop? Are you losing the connection between a laptop and the router (in a local level) or just you can not open web pages on the web?
-
It's a long story, but let's say that I earn money online. There is no possible way to use Wine or Crossover under linux system;)
-
You are right my friend. For example: Red Hat 7.x runs much, much faster than win 95, but I'm using 95 b/s of the software on that machine.
-
Because of the hardware on the machine.
-
Should I know it ??? Well, if someone ask me whether Microsoft still supports 98, 2000, millenium, XP, I'm not sure that I can give him a correct answer, the same I could say for OS's X. Anyways, thank you for reply, so I found a patch for 95 and 98 into the web - http://virusdefence.org/bulgarian-phonetic-cyrillic-support-for-windows.html
-
Hi friends, I don't use a windows system more than 13 years. So, I have a windows 95 but just forgot how to install Cyrillic layout into it. I wrote a message to the microsoft support service for now without any response. Does someone have an idea?
-
Make sure, that your password field does not hash empty values before save data to db.
-
Just, change the name of the password filed in your view, let's say from "password" to "passwd". After that change that line: $this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['passwd']);
-
When MySQL has been started, by default it takes the time zone of the local machine(server). If you are using shared hosting server, you don't have permissions to change a global time zone on the server and the database. By default each client that connects has its own time zone setting, given by the session time_zone variable in MySQL. You can change your own time_zone using the sql SET statement. For example: SET time_zone = 'America/Toronto' or SET time_zone = '+07:00' or ALTER DATABASE <database_name> SET time_zone = 'America/Toronto' Take a look at here to obtain much more details about this.
-
Where is the showphoto.php file and the line #259 ?
-
I think, the execution path to the arp table is wrong. Does ip address 192.168.1.18 belong to the local machine? There is nothing wrong about $_SERVER['REMOTE_ADDR']. Try to change /usr/sbin/arp -an to /sbin/arp -an
-
That one should work, b/s you have ids to input elements. console.log($(":input#username").val().length);
-
It depends what you want to do. For now rid the selector off your code. Example: console.log($("#usernameLength").val().length);