Search found 175 matches

by AdoptiveSolution
Thu Mar 26, 2020 10:56 pm
Forum: PHP coding => General
Topic: AJAX request, value of hidden field is part of key in php array $_POST
Replies: 2
Views: 29

Re: AJAX request, value of hidden field is part of key in php array $_POST

Try addding the = character.

Code: Select all

 "&loginActive=" + $("#loginActive").val(),
by AdoptiveSolution
Wed Mar 11, 2020 11:52 am
Forum: PHP coding => General
Topic: 'exit' in registration system.
Replies: 2
Views: 115

Re: 'exit' in registration system.

Give the input field a minimum and maximum length and check the length while typing. When the correct minimumlength, enable the submit button. The maxlength attribute automatically limits the input. <script> function checkInputLength() { document.getElementById("submit").disabled = true; var nameVal...
by AdoptiveSolution
Wed Mar 11, 2020 2:38 am
Forum: PHP coding => General
Topic: Don't know if the problem is me, mysql or php
Replies: 4
Views: 163

Re: Don't know if the problem is me, mysql or php

Try this :

Code: Select all

$sql = "SELECT * FROM users WHERE username = '" . $username . "' && password = '" . $password . "'";
by AdoptiveSolution
Thu Mar 05, 2020 12:29 am
Forum: PHP coding => General
Topic: CURL DETECTED AS ROBOT (Need HELP)
Replies: 3
Views: 193

Re: CURL DETECTED AS ROBOT (Need HELP)

You can set the user agent as explained here :

https://stackoverflow.com/a/2440753

See if that helps.
by AdoptiveSolution
Sat Feb 29, 2020 9:22 am
Forum: PHP coding => General
Topic: T string error
Replies: 2
Views: 195

Re: T string error

Try :

Code: Select all

session_start();
by AdoptiveSolution
Fri Jan 24, 2020 2:05 am
Forum: PHP coding => General
Topic: $_POST does not have the CR LF chars
Replies: 3
Views: 121

Re: $_POST does not have the CR LF chars

You lost the CR LF characters when you copied them from the textarea to the input field.

You should process $_POST['name_emailComments'] instead of $_POST['post_emailComments'].
by AdoptiveSolution
Tue Jun 05, 2018 11:40 pm
Forum: PHP coding => General
Topic: Get last word with preg_match
Replies: 2
Views: 772

Re: Get last word with preg_match

This gives the result you want if (preg_match('/(.*)-(.*)-(.*)-(.*)/', $str, $match) == 1) { $part1 = $match[1]; $part2 = $match[2]; $part3 = $match[3]; $part4 = $match[4]; } echo '<pre>'; print_r($match); echo '</pre>'; ?> Unless there's a reason to use preg_match, why not use explode()? <?php $mat...
by AdoptiveSolution
Tue May 29, 2018 10:42 am
Forum: PHP General
Topic: Need help with multiple selection
Replies: 1
Views: 733

Re: Need help with multiple selection

Give the checkboxes in the form a name : <input type="checkbox" name="services[IT Design]" value="IT Design">IT Design <input type="checkbox" name="services[App Design]" value="App Design">App Design <input type="checkbox" name="services[Graphic Design]" value="Graphic Design">Graphic Design <input ...
by AdoptiveSolution
Mon May 07, 2018 7:08 am
Forum: PHP coding => General
Topic: Last 4 characters of a filename
Replies: 4
Views: 924

Re: Last 4 characters of a filename

Code: Select all

$year = substr($imagename, -4);
It's in the manual, example #1

http://php.net/manual/en/function.substr.php
by AdoptiveSolution
Mon May 07, 2018 4:04 am
Forum: PHP coding => General
Topic: SimpleXML asXML Not Working As Expected
Replies: 1
Views: 1002

Re: SimpleXML asXML Not Working As Expected

To see what's returned, use this : <?php echo '<pre>'; print_r( $xml ); echo '</pre>'; ?> Then, after studying the code, use this sample code to display the content : <?php $url = "https://gunretort.xyz/api.php?action=query&list=search&srsearch=NewTag&srwhat=text&srnamespace=0|3000&format=xml"; $xml...
by AdoptiveSolution
Mon Jun 26, 2017 12:01 am
Forum: PHP General
Topic: issue with remarks request method
Replies: 2
Views: 2003

Re: issue with remarks request method

I don't think this is correct as a value :

5\r\n
by AdoptiveSolution
Thu Jun 22, 2017 10:06 am
Forum: PHP coding => Images
Topic: Redimensionner une image
Replies: 2
Views: 2428

Re: Redimensionner une image

Here's how you determine the width and height of an image : foreach( $tab_image as $image ) { // http://php.net/manual/en/function.getimagesize.php $size = getimagesize($repertoire . '/' . $image); $width = $size[0]; $height = $size[1]; echo '<pre>'; print_r($size); echo '</pre>'; ?> <li> <img src="...
by AdoptiveSolution
Sun Jun 04, 2017 8:28 am
Forum: PHP coding => Images
Topic: PHP Troubleshooting Audio & Image will not load on new page
Replies: 3
Views: 2826

Re: PHP Troubleshooting Audio & Image will not load on new page

Here's the code for the play.php file <html> <body> <?php $image = $_GET[image]; $song = $_GET[link]; ?> <img src="pictures/<?php echo $image; ?>" height="475" width="777"><br> <audio controls autoplay> <source src="dashboard/files/wmb/<?php echo $song; ?>" type="audio/mpeg"> Your browser does not s...
by AdoptiveSolution
Thu May 18, 2017 3:02 am
Forum: PHP coding => General
Topic: SELECT Query with $_Sessions
Replies: 2
Views: 1134

Re: SELECT Query with $_Sessions

Try this :

Code: Select all

$sql = "SELECT * FROM members WHERE username = '" . $_SESSION[username] . "' AND memberID = '" . $_SESSION[memberID] . "'";
by AdoptiveSolution
Thu May 04, 2017 12:29 pm
Forum: PHP Scripts
Topic: Naming an option
Replies: 2
Views: 2013

Re: Naming an option

Try this :

Code: Select all

<select name='SelStore'>
Info :

https://www.w3schools.com/tags/att_select_name.asp
by AdoptiveSolution
Wed Apr 05, 2017 7:42 am
Forum: mySQL & php coding
Topic: Man input to mysql works but not variable.
Replies: 2
Views: 1429

Re: Man input to mysql works but not variable.

Look carefully and notice that the bad test has the date/time without quotes.

Try this :

Code: Select all

$sql = "UPDATE $mydb SET $myfield = '" . $dte . "'";
or

Code: Select all

$sql = "UPDATE $mydb SET $myfield = '$dte'";
Then echo the line to see it.
by AdoptiveSolution
Mon Mar 27, 2017 12:26 pm
Forum: PHP coding => General
Topic: Assistance with opening a URL in a new window.
Replies: 5
Views: 1483

Re: Assistance with opening a URL in a new window.

Your problem was creating the SELECT dropdown list in a FORM.

You now have the solution to open a new browser window when you press SUBMIT.

Use a domainname URL instead of localhost.
by AdoptiveSolution
Mon Mar 27, 2017 9:47 am
Forum: PHP coding => General
Topic: Does Anyone Know why PHP is Throwing This Error?
Replies: 1
Views: 833

Re: Does Anyone Know why PHP is Throwing This Error?

You didn't make a connection to the database :

http://php.net/manual/en/mysqli.real-escape-string.php
I'm new to mysqli
That's why they invented manuals.
by AdoptiveSolution
Sun Mar 26, 2017 11:13 pm
Forum: PHP coding => General
Topic: Assistance with opening a URL in a new window.
Replies: 5
Views: 1483

Re: Assistance with opening a URL in a new window.

Curl and JSON has nothing to do with your problem. What you need is a FORM with a SELECT menu and a GET method. Standard HTML which you can find in the manual. <?php $output_json = '[ { "name": "App1", "description": "", "id": 10 }, { "name": "App2", "description": "", "id": 20 }, { "name": "App3", ...
by AdoptiveSolution
Sat Mar 25, 2017 7:32 am
Forum: PHP coding => General
Topic: Sorting an array
Replies: 2
Views: 1082

Re: Sorting an array

Try this : <?php $json = '{ "england":{ "goals":"2", "games":"3", "wins":"2", "loss":"1" }, "wales":{ "goals":"2", "games":"3", "wins":"2", "loss":"1" }, "scotland":{ "goals":"2", "games":"3", "wins":"2", "loss":"1" } }'; $array = json_decode($json, true); echo '<pre>'; var_dump($array); echo '</pre...
by AdoptiveSolution
Mon Mar 20, 2017 2:09 pm
Forum: PHP General
Topic: Forms data empty
Replies: 1
Views: 1210

Re: Forms data empty

Check the {}

The nesting is wrong.

With or without data, a connection is made with the database and a record is added.

If no connection is made, de INSERT statement will still be executed, with an error as a result.

So again, check the nesting of the code.