scootstah
Staff Alumni-
Posts
3,858 -
Joined
-
Last visited
-
Days Won
29
Everything posted by scootstah
-
The same way you got this result earlier by dumping the $_POST: array(0) { }So just do this in the same place:var_dump(file_get_contents('php://input'));
-
Actually, you know what - I'm totally on the wrong path here. I left out an order of magnitude on your request size - it's only 1.5KB, not 1.5MB. So the upload size is most certainly not the problem here. Did you try getting output from this: file_get_contents('php://input'); after your form submission?
-
It looks like you may be using FastCGI instead of mod_php5. So, there should be a PHP service that you need to restart before the change to the php.ini would take affect. I'm not sure what your hosting environment is, or if you're on a VPS or what, but the service is usually like php-fpm or php5-fpm or something like that. Restarting the whole machine would work too, if that is an option.
-
Are you sure you're in the right file? According to the phpinfo you posted, it is only set to 2M. Loaded Configuration File /opt/alt/php56/etc/php.ini
-
Okay, I was interested in this value: upload_max_filesize which is set to the default 2M. Since you're using enctype=multipart/form-data, it's going to take this value into consideration. According to your request the content-length is only 1.5MB, but I'm not sure what other overhead it may be counting. So I would go ahead and increase that value in the php.ini and see if that helps things. Something like 10M or 20M should be okay. Make sure to restart apache afterwards.
-
Okay, so the value is there properly in the request. What is that empty array you posted last, is that $_POST? It might also help to post the output from file_get_contents('php://input');, as well as phpinfo();.
-
When I test your code I don't see anything weird. <?php if (!empty($_POST)) { var_dump($_POST); echo '<br /><br />>'; } ?> <script type="text/javascript"> var maxAmount = 28; function textCounter1(textField, showCountField) { if (textField.value.length > maxAmount) { textField.value = textField.value.substring(0, maxAmount); } else { showCountField.value = maxAmount - textField.value.length; } } </script> <form method="post" enctype="multipart/form-data" id="formAd"> Line 1: <input type="text" placeholder="Remaining Characters" autofocus style="width: 250px;" name="Line1" maxlength="28" onKeyDown="textCounter1(this.form.Line1,this.form.countDisplay1);" onKeyUp="textCounter1(this.form.Line1,this.form.countDisplay1);"/><input readonly type="text" style="width: 35px;" name="countDisplay1" size="2" maxlength="2" value="28"/><input type="checkbox" name="bold" value="1"/> <strong> Make the first line bold.</strong><br> <button>Submit</button> </form>Outputs:array(2) { ["Line1"]=> string(16) "http://test.test" ["countDisplay1"]=> string(2) "12" } Can you do something quick for me? Using Chrome, open the Developer Tools by pressing Ctrl+Shift+I, or by going to the menu > More Tools > Developer Tools. Once open, go to the Network tab at the top, and then submit your form. This will capture the request sent to your PHP script. You can click on the new entry and view details of the request to the right. I'd like you to post the "Request Headers" and "Request Payload" sections here. A screenshot would be perfect. I've added an example screenshot below.
-
You'd have to do something like this: <?php $name = $_REQUEST['name'] ; $email = $_REQUEST['email'] ; $message = $_REQUEST['message'] ; $body = sprintf( "Name: %s\n\nEmail: %s\n\nMessage: %s", $name, $email, $message ); mail( "[email protected]", "Feedback Form Results", $body, "From: $email" ); header( "Location: http://www.yoursite.com/thankyou.html" );
-
It has nothing to do with the readdir function, it has to do with PHP's loose type. Did you skip this part in the manual?
-
What is your question exactly? The documentation goes over what you want to do - https://developers.google.com/youtube/v3/getting-started If you're looking to hire someone you might try posting in the job offering section.
-
No, you should put font-style and font-weight properties in the @font-face selector. This is so that CSS knows which font file to use when those properties are used later. For example: @font-face { font-family: 'SomeFont'; font-style: normal; font-weight: 400; src: url('SomeFont.ttf') format('truetype'); } @font-face { font-family: 'SomeFont'; font-style: normal; font-weight: 300; src: url('SomeFont-Light.ttf') format('truetype'); } @font-face { font-family: 'SomeFont'; font-style: normal; font-weight: 700; src: url('SomeFont-Bold.ttf') format('truetype'); }So then later when defining styles if we say font-weight: 300, it will use SomeFont-Light.ttf, if we say font-weight: 700 it will use SomeFont-Bold.ttf, etc.
-
Try: $("#slc-quarter").change(function () { var quarter = $(this).val(); $.ajax({ url: "searchQuarterDetails.asp?term=" + quarter, dataType: 'json', success: function (data) { $("#qstartDate").val(data[0].qstartDate); $("#qendDate").val(data[0].qendDate); } }) })
-
Good idea, because it seems background gradients aren't supported by transition either.
-
Okay, so you do have an ID. You should be using it as the checkbox value. <td> <input type='checkbox' name='mail[]' value="<?php echo $row['id']; ?>" checked> <?php echo $firstName;?> </td>Then, you can do this:if (!empty($_POST['mail'])) { $ids = array_map('intval', array_values($_POST['mail'])); $sql = "SELECT user_email FROM user_project WHERE project_id='$project_id'" AND id IN(implode(',', $ids))"; $result=mysqli_query($conn,$sql); $to = array(); while ($row = mysqli_fetch_assoc($result)) { $to[] = $row['user_email']; } mail(implode(', ', $to), $subject, $message, $headers) }This will select the emails chosen from the database, and also ensure that valid options were chosen.
-
So something like this then? $("#slc-quarter").change(function () { var quarter = $(this).val(); $.ajax({ url: "searchQuarterDetails.asp?term=" + quarter, success: function (data) { $("#qstartDate").val(data[0].qstartDate); $("#qendDate").val(data[0].qendDate); } }) })
-
So do you mean HTML errors?
-
Can you post the full schema for your user_project table? Run this query and post the output: SHOW CREATE TABLE user_project
-
The Super Cool Mostly Official Frankenstein-Code Game Thread!
scootstah replied to .josh's topic in Miscellaneous
You know this thread is like 9 years old, right? -
Because you're trying to use the same ID on multiple elements. ID's are unique. Use a class, or add something unique to the ID, like a number. jQuery(function($){ ... $(".phone").mask("(999) 999-9999"); ... }); <td><input class="phone" name="Phone[]" size="10" maxlength="10"/></td> OR jQuery(function($){ ... $("[id^=phone-]").mask("(999) 999-9999"); ... }); <td><input id="phone-1" name="Phone[]" size="10" maxlength="10"/></td> <td><input id="phone-2" name="Phone[]" size="10" maxlength="10"/></td> <td><input id="phone-3" name="Phone[]" size="10" maxlength="10"/></td> <td><input id="phone-4" name="Phone[]" size="10" maxlength="10"/></td> <td><input id="phone-5" name="Phone[]" size="10" maxlength="10"/></td>
-
https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie https://developer.mozilla.org/en-US/docs/Web/API/Window/location Here is relevant documentation for what you want. The first is about cookies, and the second is about window.location which is what you use to get the query string. Specifically, you want the search property, window.location.search.
-
What is so bad about Blade that you cannot use it?
-
Not sure what your images are since the URL doesn't work, but if it's just a gradient or something than you can use CSS to create it.
-
http://php.net/glob EDIT: Nevermind, I see you want to count the content within files and not the files themselves. EDIT Again: In pseudo code, this should be what you want, ya? numSubscribed = 0 numUnsubscribed = 0 while loop through files content = file_get_contents(file) if (content == 'subscribed') numSubscribed++ else if (content == 'unsubscribed') numUnsubscribed++ endwhile
-
A question regarding delete user session
scootstah replied to helloworld001's topic in PHP Coding Help
Nope, that was your idea. But it doesn't make sense to dump all of the session data in there alongside having filesystem sessions, if all you want to do is track if a user is online or not. -
A question regarding delete user session
scootstah replied to helloworld001's topic in PHP Coding Help
The proper way to do this would be to write an adapter that reads/writes the session to the database, instead of to the default file system location. You're basically storing sessions in two locations right now, which is not ideal. If you simply want to track which users are online, then you could add a simple "last_active" timestamp to the users table. Whenever the user visits a page, update this last_active value. Then have some logic that says if the last_active timestamp is within so many minutes of the current timestamp (so it's <15 minutes old, for example) then they are online. EDIT: http://php.net/manual/en/session.customhandler.php Here is the information about the session handlers to be able to read/write sessions to a database table.