-
Posts
1,469 -
Joined
-
Last visited
-
Days Won
12
Everything posted by CroNiX
-
Why would you want to turn off a deprecation notice? Its kind of important to not use things that are going to be removed from PHP if you want things to work in the future.
-
Move html to another area with css on a responsive layout?
CroNiX replied to Dragosvr92's topic in CSS Help
You can't with just CSS. Why not just change their locations in the HTML of your template/page? -
I believe mac_gyver answered that
-
Databases are designed to handle millions of records, so storing tons of data shouldn't be a problem. The key to a high performing database is the indexes you place on the various fields. You only showed this db code: $stmt = $db->prepare("CREATE DATABASE IF NOT EXISTS :dbname"); $stmt->bindValue(':dbname', $uname, PDO::PARAM_STR); $stmt->execute(); But, you do have a connection somewhere, using a mysql user and password somewhere before you try to do that, right? It's THAT user who needs the CREATE permission.
-
Yes, just have php parse it and send the final HTML back in the ajax request instead of individual parts. Well, you'd have 2 parts with the html and the title. something like [ {html: '<strong>The HTML</strong>', title: 'The Title'}, {html: '<strong>Different HTML</strong>', title: 'Another Title'} ] Then in the loop infowindow.setContent(data.html); infowindow.setTitle(data.title);
-
Unless the mysql user has CREATE permission, they can't create databases or tables. http://dev.mysql.com/doc/refman/5.1/en/privileges-provided.html I'd just use a single table for the users. Once they log in with username/pass, you can grab the data associated with that user using their userid. Personally I'd like to only maintain a single table in a database rather than hundreds or thousands of different databases, depending on how many users there ends up being. What if something changes in the future? Updating the schema for a single table is much faster than 1 per user.
-
I believe infowindow.setContent() only accepts one parameter - the entire HTML to replace the content of the infowindow with. There is also infowindow.setTitle(title) to update the title.
-
First, why would you create a new db for each user? That's not a normalized database. Second, does your mysql user performing that query have permissions to CREATE?
-
I need to add a check box that will change status of a record
CroNiX replied to kat35601's topic in PHP Coding Help
It doesn't look like you have error reporting turned on, or you'd receive a notice that $sql_short isn't defined (since you used it just BEFORE you defined it in your odbc_exec()). $update=odbc_exec($connect,$sql_short); //This needs to come BEFORE you try to use it above!! $sql_short="update wip_master set status='9' where uompScheduleNumber='$schedule' and serial='$serial'"; Still have a way to go, but before continuing on it would be best to turn error reporting ON so you SEE the errors so you can fix them. Otherwise you're just shooting blind. -
What is isempty()? Never seen that. Shouldn't it just be "!empty()"? You're also missing a closing parenthesis there after the $userid check.
-
Exlude .gif .png images from directory listing script
CroNiX replied to astarmathsandphysics's topic in PHP Coding Help
How are you getting the files ($this->files) to begin with? You can use php's glob function to only get files you want from a dir, like: $files = glob('/path/to/files/*.html'); //$files is now an array of all .html files in the /path/to/files/ dir -
The used command is not allowed with this MySQL version
CroNiX replied to Drewser33's topic in MySQL Help
I have no experience with that particular problem, but could it be that the mysql user doesn't have permission to the /var/tmp dir? Really just a guess... -
That's a bit difficult without a 3rd party service. Each cell provider has a different way to send SMS to it's customers, and most likely you won't be able to find them ALL. There are services like Twilio that have an API to help. You can find more by googling "sms from website". Basically you'd just generate a unique code on your site, store it in the database for the user and send the SMS to them with their code. There would be some form on your site where they enter the code and you'd check it against the database. You probably also want to set a time limit on how long the code is valid for. You'd of course also need to know the users mobile phone number.
-
Exlude .gif .png images from directory listing script
CroNiX replied to astarmathsandphysics's topic in PHP Coding Help
It might be better to check the mime type rather than rely on the file extension, unless you've already done that when the images were uploaded. I can rename dangerous_code.php to lovely_image.jpg pretty easily -
$url = "/alldaymovies/" . $filename; //you need to concatenate the variable $url = "/alldaymovies/$filename"; //or put it in the quotes
-
because you have pure html in your PHP code. Move <form action="next_page.php" method="post"> to above your php open tag
-
Madly new to PHP and a noob in need of discussion and help!
CroNiX replied to achan99's topic in PHP Coding Help
You can't set a cookie and immediately read from it because it hasn't been sent to the browser yet until the end of the requests cycle. Then, on the next page accessed, you can read from the cookie. 1) set cookie 2) at end of code execution cycle when the script sends all output to the browser, the cookie header is also sent to the browser 3) request a new page (or same page) 4) cookie data is sent back to the application in the headers from the browser 5) can now read from $_COOKIE in application Try this: if ( ! isset($_COOKIE['testcookie'])) { setCookie('testcookie', 'our value'); //must be created before any output echo 'cookie does not exist, so we just created it. Reload this page to see it.'; } else { echo 'cookie was created and its value is: ' . $_COOKIE['testcookie']; } -
Madly new to PHP and a noob in need of discussion and help!
CroNiX replied to achan99's topic in PHP Coding Help
An easy way is to use your browsers "developer" tools, which vary from browser to browser. Most can show cookie data, as well as ajax requests and a lot of other things. -
Did you check the docs for mysqli_query() regarding the parameters? You can't just add a "i" to the end of the old mysql functions for them to work in mysqli.
-
Mail sent by mail() marked as spam... free email sending?
CroNiX replied to moose-en-a-gant's topic in PHP Coding Help
Email is an art, with a heck of a lot of complications if you want to get delivered straight to the inbox. Many things can affect it such as the headers you send, whether or not the "from" is an email account on your actual domain (user@xyz.com shouldn't be sending as user@abc.com), domain reputation, spam filters on the domain the mail is being sent TO, whether or not your domain has a PTR record, whether you have a SPF record, whether you have DKIM setup, whether or not your IP/Domain is listed in a RBL, whether or not your email server is acting as an open-relay, and a myriad of other things. Most people aren't experts and this goes WAY beyond using code to send email. If you have mission critical email, I'd really use a 3rd party solution such as sendgrid. One place to start would be something like mxtoolbox. Enter your mail servers domain (like mail.yourhost.com) and see what it says. -
Ah, yes, you have the parameters in the wrong order
-
Are you still having the problem? I see you edited and added the ) to mysql_query() in your original post. It's also never wise to just assume your queries run and continuing on, without first checking for an error. See example 1 in the docs for mysql_query(). Most likely that will tell you where you are going wrong. Also pay attention to the deprecation warning at the top of the page for mysql_query(). If you want your code to run on future versions of PHP you should be using the PDO or MySQLi extension, not MySQL (without the i at the end)
-
You are missing the closing parentheses around your mysql_query() function call