Jump to content

All Activity

This stream auto-updates     

  1. Today
  2. I was using a api from google but whenever i pass it though a form via post, it gets me error. Invalid value ''.https://google.com.'/'. Values must match the following regular expression: '(?i)http(s)?://.*' [locationType] => parameter [location] => url ) ) [code] => 400 [message] => Invalid value ''.https://google.com.'/'. Values must match the following regular expression: '(?i)http(s)?://.*' ) ) <?php if(isset($_POST['url'])){ $url = $_POST['url']; ( I hid code rest code because of api But i get above error. ) $val = json_decode($result, true); //return $val; print_r($val); } ?> <form action="" method="post"> Url <input type="url" name="url"> </form> What should be added to pass url variable correctly? I tried using w3school method but i still get the same error.
  3. I have a shopping cart that holds an array or my objects. I have all my customer user details serialized with a form and jQuery. I would like to insert the user data I got from my user details form (maybe I use payer or payer_info? Object. Also I would like to insert my items to the paypal CreateOrder: actions.order.create({ I am guessing I do it like this? "item_list": { "items": [ { "name": "hat", "description": "Brown color hat", "quantity": "5", "price": "3", "tax": "0.01", "sku": "1", "currency": "USD" }, { "name": "handbag", "description": "Black color hand bag", "quantity": "1", OR maybe in This is what I have $fname = $_POST['txtFirstname']; $lname = $_POST['txtLastname']; $email = $_POST['txtEmail']; var totalPrice = <?php echo $newTotal; ?> paypal.Buttons({ createOrder: function(data, actions) { // setup transaction return actions.order.create({ payer: { name: }, purchase_units: [{ amount: { value: totalPrice } }] }); },
  4. phreak3r

    POST error upon uploading a file

    An example? Please and thank you!
  5. Yesterday
  6. Barand

    Matching number elements

    You may find my reply to one of your previous topics of interest here. (I sometimes ask myself why we bother)
  7. Jayfromsandiego

    Matching number elements

    Thank you for your help and suggestions, as always requinix. πŸ™‚ I think I am also going to look into >> array_diff($a, $b),
  8. requinix

    Matching number elements

    Working with those numbers as a string is proving to be a pain, isn't it? Then don't work with them as a string. Use an array, for both the input as well as the stored numbers. You can display them as a hyphenated string, but internally keep them as an array. explode() and implode() can help you convert between the two forms. Then the problem is how to take an array of five numbers and check against other arrays of five numbers to find what they have in common. Fortunately there's a function for that.
  9. Jayfromsandiego

    Matching number elements

    Hello group. I need some help with my code. <?php $a1 = array("line1"=>"1-2-3-10-14","line2"=>"1-2-3-10-34","line3"=>"1-2-7-16-35","line4"=>"1-2-3-17-19","line5"=>"2-5-11-15-32"); $a2 = array("inputnumber"=>"1-2-3-10-34"); $result = array_intersect($a1,$a2); print_r($result); ?> Right now, I can only search and find an exact match of all 5-Numbers. I want to code a PHP form that will take a (5-number string) as input and then compare that string against an array database of (5-number strings) to find all matching number occurrences for each β€œLINE 1 thru LINE 5”. For instance, if I were to type the 5-number string β€œ1-2-3-10-34” as input. The Output populated results would look like this ..
  10. Well, I found some { } brackets must have been out of place, i'm sure that's nothing new, especially to a newbie like me. :) The verse's Are now getting posted correctly to the Bot. I have to fine tune it because the other repsonces now are not.. either or an if, something can go wrong, it will.. hehe I am on the correct path now, THANK YOU! Any more tutoring/advise.. is *always* Appreciated.. I will let the thread know as soon as I complete my chase and hunt down. of the rouge bracket. :/ Cheers.
  11. is that a trick question, lol ok so its basically stick inside that? while() function? i am pretty new to this sql anyways. i appreciate your teaching/not just sharing 'the answer', the thing that gets me, is it DOES echo the correct result. etc. but i think you are aware of that.. ok, so, my answer, most likely wrong is it is residing in the IF statement, "stuck". ? i will be diligent and look also for proper routine, it is straight from W3Schools though, here. my quote for you, .."In Teaching, Two people learn." :) Thanks!
  12. That article explains how to authenticate SMTP. You need to post the code for us to help you .
  13. Hi, thanks for helping but the issue is NOT fixed yet. I don't think this article has anything to do with my problem because my codes are set accordingly. The problem is that my hosting does not support it because SMTP authentication is not done, I have no idea how it can be. However, it worked perfectly with my old host and it was possible to simply reply.
  14. First using 777 is very dangerous so you really don't want those permissions. Second, just because the directory 'db' has those permissions, it does not mean the upper level directories have the correct ownership or permissions. You have to look at each level.
  15. gally06

    Creating Setup

    Thank you so much for your reply, just so keen to learn and keep progressing and think I am being mighty ambitious with this project lol, but we all gotta have aims right.
  16. In ubuntu 18.10 , i created a folder name db in the external usb hard dirve changed the ownership to the www-data the apache2 server and set the permissions to 777 , i run this php code and get the permission error: <php chdir('/media/user/e46cafba-2656-4e42-b1c9-6417f28839df/db/'); system('./rs'); ?> but the php code cannot change to the dir and get the error: [21-Feb-2019 10:43:26 UTC] PHP Warning: chdir(): Permission denied (errno 13) in /home/user/www/html/rse4db.php on line 5
  17. requinix

    Finding Past Due Dates

    If you used actual NULLs and not 0000-00-00 dates then you wouldn't have to care about them. It's also better from a purist standpoint as a lack of data is what NULL is supposed to mean. SELECT * FROM Prospects WHERE UserID = ? AND FollowUpDate < ? Because comparing NULL with anything fails so those rows won't be matched.
  18. TapeGun007

    Finding Past Due Dates

    Ah nvm, I got it unless there is a better way to write this, I would be interested. SELECT * FROM Prospects WHERE UserID = ? AND FollowUpDate < ? AND FollowUpDate > '0000-00-00'
  19. TapeGun007

    Finding Past Due Dates

    mySQL Server Version 5.7.23
  20. Take a look at the code where you fetch the verse from the database. if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) ; //$conn->close(); } Here's the thing: $row is only useful inside the body of the while loop, so... where is the body of the while loop?
  21. TapeGun007

    Finding Past Due Dates

    Not all items in my database have a due date. I already have a page that lists everything that is due today and that's fine. What I want to do is sort out all of the null dates "0000-00-00" but list the overdue items (past today) and not the current due dates (today's date). This was my failed attempt: $stmt = $pdo->prepare('SELECT * FROM Prospects WHERE UserID = ? AND FollowUpDate IS NOT NULL AND FollowUpDate < ?'); $stmt->execute([$ID,$today]); The above will list all the dates that are null anyway. I can't seem to figure out how to write this correctly. Thanks.
  22. So glad I found this forumn! Greets to everyone. I have been (re)learning (or trying to) some PHP code. i have been working on this script for a semi-simple facebook bot. to send a 'verse' (or chapter "quote"-(that i already have in my SQL DB ready and right.) from a 'book'. The last part is getting it to work with this FB "bot", it works on my PAGE (i can manipulate the $input variable, (acting like a person inputting something to the Bot, i just change the $string ($messageText), when i copy it over to the actual 'bot.php' script, everything works as required, simple 'auto-replies' to 'given' phrases, no replies to just general 'chat'. etc.. when i use the necessary line (which works great in the test/localhost) it all works Except that one call (which is the whole point of the bot mostly). when i use the 'secondary' line (simple, very similar, but Not accessing the SQLi) it works ... i'm stumped, they're practically identical (in logic/theroy). here is the part i'm trying to defeat at this moment. Thanks for your attention, and suggestions.. :) [...] if ($msgat == "@"){ //$answer = "This works."; // <-- This Does Work. a simple $string.. live, within the use of the bot. $answer= " " . $row["verse"]; // <-- This does Not work, but it does 'locally' ??why not? :) } [...] pastebin code is here. (https://pastebin.com/DJyAJZVb) it all checks out, as far as i can make it, i have ran it through PHPcheckers, php -l, and loaded it into various editors to help determine missing "brackets, etc". it works except for that one area. here is what i think matters for knowing, so far. (or you can check out the pastebin link, thanks! [...] $mysqli = "SELECT verse FROM ".$datatable." WHERE book LIKE '%".$message."'"; $result = $conn->query($mysqli); if ($result->num_rows > 0) { // output data of each row while($row = $result->fetch_assoc()) ; //$conn->close(); } { if ($msgat == "@"){ //$answer = "This works."; // <-- This Does Work. a simple $string.. live, within the use of the bot. $answer= " " . $row["verse"]; // <-- This does Not work, but it does 'locally' ??why not? } //echo $answer; // <-- used in localhost test script it works and echos either or of the above $answer showing correctly. else if($msgat[0] != "@"){ $answer = $answer;} [...] ------------------------------------------------------------------------- Any suggestions,help, or direction would be greatly appreciated, i have spent probably.. well, too long on this.. lol Cheers, and thanks for having this forum. GX1705
  23. PHPOMY

    PHP Not connecting to SQL Server

    Got it working now this can be marked as resolved Thank you
  24. PHPOMY

    PHP Not connecting to SQL Server

    Ok I see what you meant now. I need to convert my mssql_connect to use PDO I have not been able to find an example of the replacement for this? you have a example of using PDO to connect to a SQL Server Database?
  25. PHPOMY

    PHP Not connecting to SQL Server

    Benanamen Thank you for the fast response I saw that link yesterday and tried that code <?php // Server in the this format: <computer>\<instance name> or // <server>,<port> when using a non default port number $server = 'SQLC,1433'; // Connect to MSSQL $link = mssql_connect($server, 'phpuser', 'xxxxxxxxxxx'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } ?> Named it testconnection.php HTTP 500 Internal Server Error. Any ideas? Thakn you Tom
  26. benanamen

    PHP Not connecting to SQL Server

    mssql_connect was removed from Php http://php.net/manual/en/function.mssql-connect.php PDO is how you will want to do it. http://php.net/manual/en/book.pdo.php
  27. Windows 2012 R2 Web Farm IIs 8.5 PHP 7.2 I am trying to create a logon page using PHP create a database on my SQL 2014 server. Installed the PHP SQL Server Drivers for PHP 7.2 <?php // Server in the this format: <computer>\<instance name> or // <server>,<port> when using a non default port number $server = 'SQLC,1433'; // Connect to MSSQL $link = mssql_connect($server, 'phpuser', 'xxxxxxxxxxxxxx'); if (!$link) { die('Something went wrong while connecting to MSSQL'); } ?> I get an HTTP 500 internal server error cant get past this one Any thing else I can provide to help us fix this let me know Thank you Tom
  1. Load more activity
  • Newsletter

    Want to keep up to date with all our latest news and information?

    Sign Up
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.