-
Posts
1,893 -
Joined
-
Last visited
-
Days Won
8
Everything posted by AbraCadaver
-
Nothing about: $test = ($_POST['marketingvalue']); Would cause: Array to string conversion in C:\wamp\www\survey\page_3.php on line 164
-
PHP unzip compressed file and unzip tar.gz file
AbraCadaver replied to rkrause54's topic in PHP Coding Help
If you have a recent PHP version and zlib compression enabled the use PharData or the Phar class or use the command if you're on Linux: exec('tar zxf /path/to/file.tar.gz'); -
remove a certain row from results array after query.
AbraCadaver replied to jason310771's topic in PHP Coding Help
Looks to me like the id is the array index? [1720]=> array(40) { ["product_id"]=> string(4) "1720" So just: unset($array[1720]); -
cannot get email to validate correctly
AbraCadaver replied to SuicidalDriver's topic in PHP Coding Help
$$ Edit: Too slow. -
cannot get email to validate correctly
AbraCadaver replied to SuicidalDriver's topic in PHP Coding Help
$Email is probably not what you think it is. echo $Email; -
No reason for a loop of all records. The database will return what you want and then you can check it. Just query to see if the one record is there: SELECT * FROM inventory WHERE vin = $_POST['vin'] And then check mysqli_num_rows() to see if you got results. If not, inset and if so don't. You should still escape the $_POST data with mysqli_real_escape_string().
-
Please help my INSERT and UPDATE scripts have ceased working
AbraCadaver replied to designsweb's topic in PHP Coding Help
If made_live is a MySQL DATE type then the format is 2013-08-28, though I don't know if that would cause a failure. -
It's probably a string. $Price = number_format((float)$preownedinfo->Price, 2);
-
Advanced search engine - Simple Matrimonial
AbraCadaver replied to tharsan17's topic in PHP Coding Help
OK. I assume the table is called Profile and not the database? If not substitute below: SELECT *, (YEAR(CURDATE()) - YEAR(DOB))as Age FROM Profile WHERE Gender = 'Female' AND Age BETWEEN 18 AND 23 -
Preselecting checkboxes based on values in database...
AbraCadaver replied to xfilterx's topic in PHP Coding Help
Try that: echo "<input type='checkbox' name='process[]' value='" . $rowProcess["process_id"] . "' selected='selected'>" . $rowProcess["process"] . "<br>"; As for the array, I showed you in my post and it is shown in the code above. In the page that receives the submitted data you woudl loop through $_POST['process'] or concatenate them or whatever you need for the end result (which we haven't seen). -
Preselecting checkboxes based on values in database...
AbraCadaver replied to xfilterx's topic in PHP Coding Help
What determines if they are preselected? If your query returns process_ids 2, 3 and 5, which ones are selected? If all of them then that easy, just add selected="selected" to all the checkboxes. Also, if you have more than one input named process then only the last one will be submitted. You need to create an array of process checkboxes: name="process[]". Then you can access the $_POST['process'] array after submit. -
Preselecting checkboxes based on values in database...
AbraCadaver replied to xfilterx's topic in PHP Coding Help
mysqli_fetch_array() returns both numeric and associative by default. You can specify with MYSQLI_ASSOC or MYSQLI_NUM with the second optional argument. -
fwrite($socket, "JOIN #channel channelkey\r\n");
-
The only way to do this without the user being able to get around it is to make them login. Even making them login can be gotten around if they signup multiple times with different ids. You could use a session var or a cookie, however the user can delete their cookies. IPs may be shared by many people and it will change if you go from your house to Starbucks.
-
And it seems as if the guy has some opinions on it as well: http://r.je/views-are-not-templates.html
-
Not sure, but I don't think there should be a colon : there.
-
change from submit to image type stops post working.
AbraCadaver replied to Lawlssbatmbl's topic in PHP Coding Help
On the add form you could set a hidden input named "add" since that's the only possibility for that form, but that won't help you on the edit/delete form because that hidden input won't let you know which button was clicked. -
change from submit to image type stops post working.
AbraCadaver replied to Lawlssbatmbl's topic in PHP Coding Help
Well, try "add_x", but maybe do a print_r($_POST) on excision.php and check it to make sure that I'm correct on the naming. You'll need to change the isset for the edit and delete as well. -
change from submit to image type stops post working.
AbraCadaver replied to Lawlssbatmbl's topic in PHP Coding Help
On excision.php you need to do a print_r($_POST) to see what the buttons are named. Instead of "add" you'll have two like "add_x" and "add_y" and the values will be the coordinates of the image that were clicked. Most likely in excision.php you're checking for $_POST['add'] or something similar. -
Your previous post was moved to MySQL. Why repost? http://forums.phpfreaks.com/topic/281477-update-field-table-value-1/
-
date() is a date formatting function. The DateTime class can format a date / time but it has many more features to manipulate dates and times etc. Since all you needed was to format todays date, I didn't see any need to create an object.
-
$newname = dirname(__FILE__) . '/Uploads/' . date('Y_m_d-H:i:s') . '-' . $filename;
-
Nevermind.
-
VALUES ('', )