-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
Post the 'garbage' you are getting. Some people's garbage is someone else's clue. I suspect that magic_quotes_runtime is on and the binary data is being escaped, thereby breaking the image data.
-
how to validate a date is formatted correctly
PFMaBiSmAd replied to jasonc's topic in PHP Coding Help
<?php $date = "2010-04-27"; // yyyy-mm-dd if (preg_match('/^(\d{4})-(\d{2})-(\d{2})/', $date, $regs)) { echo "$date is a valid format.<br />"; if(checkdate($regs[2], $regs[3], $regs[1])) { echo "$date is a valid date.<br />"; // the $date is both a value format and a valid date } else { echo "$date is not a valid date.<br />"; } } else { echo "$date is not a valid format.<br />"; } ?> -
Are you sure about the actual path to the file - /Users/xyz/ ?
-
Because php is actually what is reading the file (the LOCAL keyword) it is having a problem with the \ characters in the file path. If you use / in the path 'C:/Users/xyz/Desktop/abc.csv' it will work (at least it did form me when I just tried it.) As to your second question. If you are uploading the files, then yes, you could probably (untested) use the ['tmp_name'] in the query to access the file.
-
Are the database details (username, password, and permissions) the same for the database with the`zeetest`table and for your user/log-in information?
-
If you got that as a mysql_error() due to a mysql_query() statement, it means that you did not have a valid connection to the database server at the time you executed the mysql_query() statement. What is your code that is connecting to the mysql server?
-
For debugging purposes, add the following two lines of code immediately after your first opening <?php tag - ini_set("display_errors", "1"); error_reporting(E_ALL);
-
Echo mysql_error() on the next line after the mysql_query() statement to find out if there are any mysql errors.
-
Authors Submit articles but Admin Approves them
PFMaBiSmAd replied to 2011's topic in PHP Coding Help
No, no one suggested doing anything like that. The only thing anyone suggested doing was to - -
Authors Submit articles but Admin Approves them
PFMaBiSmAd replied to 2011's topic in PHP Coding Help
About the only thing worth adding would be to use a third value for articles that have been reviewed but rejected so that you don't automatically see them when retrieving new articles awaiting approval. And why not just delete rejected articles you might be asking yourself. Well in most real life applications, data is not actually deleted. Something that might be rejected today, might be usable at a future date and you need to keep a record of who submitted what (perhaps someone keeps submitting similar articles using different usernames and you need some way of tracking who is doing what.) -
Here is a real life example. This forum currently has - 1,043,925 Posts in 198,897 Topics by 91,882 Members. Do you believe that each of the 91k members of this forum has a separate table OR that all the posts by all the members are stored in one table using a member id to identify who wrote each post?
-
The client-side I was referring to was the client that connects to the msyql server (which is php in this case.) It has nothing to do with javascript, which is client-side when discussing web servers and http requests, not database servers and queries. It's best to store same-meaning/same-structure data in one table. If the only thing that is different between data is a value or a category it belongs under or a user it belongs to, then it is same-meaning/same-structure data. In general, you would have a user id column in your data table that identifies which rows belong to each user, not a separate table for each user and where you are using up to 5 different tables for each user, you would simply have up to 5 rows per user in the single data table.
-
The overall (initial and final) quotes on the string being assigned to $query must be double-quotes to get php variables inside the string to be replaced with their actual runtime value. Is there some reason you are not using the client-side prepared statement support as it is many times more efficient than the server-side prepared statements you are trying to use. Also, don't dynamically produce tables for each different user and class. That will result in a data management nightmare.
-
You need to use mysqli correctly (some of the problems with your mysqli code have been pointed out in the thread.) There is not an exactly 1:1 conversion between mysql and mysqli usage. Yes, the mysqli extension needs to be installed, just like any of the other php language extensions. Are you developing and debugging your code on a system with error_reporting set to E_ALL and display_errors set to ON in your master php.ini (when you have access to it), in a local php.ini (when php is running as a CGI application), or using equivalent settings in a .htaccess file (when php is running as an Apache Module) so that php would help you by reporting and displaying all the errors it detects? You will save a TON of time.
-
Sorry to pick, but if you are developing php applications that you are going to publish on the Internet for others to use, you must be aware of and follow basic proper php syntax such as using quotes around index names. Also, developing such an application on a system with full php error reporting turned on (which would have exposed the problem of not putting quotes around the array index names), not using short open tags (assuming you are), and not relying on register_globals or any of the other depreciated php language features would be prerequisites as well.
-
If you put the dynamically generated URL into the HTML form, it will be in the hands of the visitor BEFORE he pays and he can use it or modify it any way he wants before payment.
-
Surprisingly, using the procedural function call mysqli_error() with OOP mysqli just worked when I tried it. However, mysqli_error() requires the $conn variable as a parameter. Otherwise you get a php Warning: and no actual output from mysqli_error that would tell you why the query is failing.
-
Yes, but is it actually being loaded? What does a phpinfo(); statement show? There should be a whole section listed (not to be confused with any openssl listed for your web server) -
-
You are going to need to actually read the documentation for the eval() function. It expects valid php code and the only way that it returns a value that you can assign to a variable is if you use a return statement in the php code being evaluated - <?php $Value = 100; $Symbol = '+'; $StartValue = 10; $EndValue = eval("return $StartValue $Symbol $Value;"); echo $EndValue; ?>
-
The php openssl extension must be enabled to allow php to connect to the mail server using the https protocol.
-
I'm going to guess that the length you are getting is ~ 1024 characters -
-
VIP INTERACTIVE SITE CREATOR - INSTALL HELP NEEDED
PFMaBiSmAd replied to cherilavelle's topic in Third Party Scripts
I recommend downloading the file using a different file name (to avoid overwriting the original file) and examining exactly what is in the file. You are likely having a FTP transfer problem and the contents of the file on the server is incomplete. -
Define: "i'm still not getting antying..." That could mean a blank screen, a failed query, a query that matches zero rows, a failed second query, the wrong value returned,...? What have you done to troubleshoot what it is doing and what are the symptoms so that someone could actually help you?
-
The end of life of php4 was over two years ago. Your web host should have provided a way of upgrading to php5, either through a choice in your hosting control panel or through a setting in a .htaccess file. There are very few incompatible changes between php4 and php5. Unless the code is using mysqli or php5's OOP syntax, it should work under php4.
-
If we assume that your actual code is not clearing the $_FILES array due to a logic error in your code (which you did not post), the only things that would cause the files array to be empty but the post array to work would be - 1) Nested form tags, where the first <form tag does not have the correct enctype. 2) Uploads are not enabled on your server.