![](https://forums.phpfreaks.com/uploads/set_resources_1/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
chhorn
Members-
Posts
115 -
Joined
-
Last visited
-
Days Won
2
Everything posted by chhorn
-
lookup websockets.
-
so if you want to look at some variable, you have to find it first. the variable is "data", and i only see the code you posted, so you hit ctrl+f on this page and type in "data" without the quotes, the only place you find this combination of charaters is within this code }).done(function(data){ form_status.find('.form-status-content').html('<p class="text-success">Thank you for contact us. As early as possible we will contact you</p>').delay(3000).fadeOut(); }); and the variable is provided as a parameter into a function. so you go into this function and place the code i posted there. and hit F12 in your browser, go to console, befor making that request.
-
you could have a look at what the server gives you back for that ajax request with console.log(data);
-
coming from MySQL in the past, i'm working with PHP+Postgres nearly exclusive for the last 5 years or so. main reason is standards compatibility, so less surprises and less wasted time with debugging, but performance and built in features are also a cause, GIS capability is great.
-
that code imsafe.zip is nowhere mentioned on this thread.
-
then your query is invalid, enable error reporting $pdo = new PDO('mysql:host=localhost;dbname=someTable', 'username', 'password', array( PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ));
-
How do I break this variable up, into unlimited amounts?
chhorn replied to simona6's topic in PHP Coding Help
If you don't know what to achieve, how should we? did you try to explode that string? is that the result you wanted? split the string up by what, with what result? -
How do I break this variable up, into unlimited amounts?
chhorn replied to simona6's topic in PHP Coding Help
So how should the array look like then? -
I bet you need the avatar more often, so a new table would involve a join or at least a separat query every time. so if your users table does not seem to be flooded with columns anyway, or the user can store multiple avatars, maybe for historical reasons, i would stick on two columns within the users table for performance and maintainability - you still can simply let the column out on queries that don't need the data.
-
How do you sync PHP code with Social Media, to show 'followers'?
chhorn replied to simona6's topic in PHP Coding Help
Best way is tu query the APIs of the platforms if available. -
I bet the mailer won't care about any file extension, just use the one you expect it to be when the client opens the mail, at least then it would be a file anyway.
-
First you have to find a source with ipv6 adressed countries, then you have to rewrite your script completely.
-
You are fetching $_GET['listing_id'] from the URL, so you have to provide that info at least in a link.
-
You can use a variable there: $photoFiles[$i] = $file; That variable $i can be initialised and incremented.
-
Why does my code automatically think the textbox is empty?
chhorn replied to Skittle's topic in PHP Coding Help
You have multiple error messages there. So if you get e.g. "City was not specified" you can check for var_dump($city); then for var_dump(trim($_POST["city"])); then for var_dump($_POST["city"]); then for var_dump($_POST); and look what each variable contains. -
How to return an entire array from a PHP Function?
chhorn replied to SaranacLake's topic in PHP Coding Help
It's not that var_dump you posted. Just have a full search over all files for "phtoFiles", looks like a spelling mistake. -
store in a session if the client was already on page 1.
-
Have you checked every variable if it contains what you expect? Post results, and maybe the image you tested.
-
Easiest way would be glob https://www.php.net/manual/en/function.glob.php
-
If YOU don't know the problem, how should WE? At least there are PHP-tags missing.
-
I would recommend not to use this low level functions. At best you take a database with ACID compatibility, if you want to get a quick slim start, use SQLite, it's mostly build-in into PHP. But at least you can use json_encode(), file_put_contents(), file_get_contents() and json_decode() for your task, so you have clean and readable interface without thinking too much. On the other hand, file handling and format manipulation is a valuable lesson. But as already said, you have to tell us what problem you encountered in detail.
-
As to the manual, "die" is an alias of "exit" which is a function, and there are examples in the manual which you should try on a standalone script first, so you learn how to call functions with the appropriate syntax. https://www.php.net/manual/en/function.exit.php Also i would recommend to not just randomly copy and paste function signatures into production code and hoping that they work as you expect, but actually learn how PHP works and what syntax is needed from the examples.
-
stop guessing: mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
-
the DateTime class can handle a lot of default scenarious, including last x day of y, so all you need is the year and month component <?php $d = new DateTime('2019-10-01'); $d->modify('last friday'); print_r($d); // 2019-09-27 $d = new DateTime('2019-11-01'); $d->modify('last friday'); print_r($d); // 2019-09-25 $d = new DateTime('2019-12-01'); $d->modify('last friday'); print_r($d); // 2019-09-29
-
Just use that .jpg name within the URL and redirect to a .php script with mod_rewrite.