Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,806 members, 7,820,819 topics. Date: Tuesday, 07 May 2024 at 10:29 PM

How To Break Down A Link In Php Code, & Call/include User Session Into The Link? - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Break Down A Link In Php Code, & Call/include User Session Into The Link? (469 Views)

I Am A Pharmacy Student Struggling To Break Into The World Of Coding / How To Hide ?m=1 From Blogger Link In Mobile View To Give Clean Url / Php Code To Make A Forum Support Youtube Embed On A Post (2) (3) (4)

(1) (Reply) (Go Down)

How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by fineboynl(m): 8:51am On Aug 09, 2018
for developer only pleased help me out, i need to call the sms APIs on my project i'm working on, its a user session account area.

http://api.ebulksms.com:8080/sendsms?username=mike3003@gmail.com&apikey=a4a2c93f419ae9e6bd5gh56608326ae045ec298&sender=informan&messagetext=Welcome_sessionName&flash=1&recipients=2348158448958

is there any way i can break this link via php and insert session info into the link from sql database table and call it?



eg

$_SESSION['hl_user']['phone']; will be in that recipients, message to send e.t.c
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by LaiveNg: 10:21am On Aug 09, 2018
Your idea is vague; it's not clear what you want to do. Normally an SMS API should have parameters to help you make requests. Simply use urlencode() function to encode the parameters you'll be sending to the URL.
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by fineboynl(m): 6:57pm On Aug 09, 2018
LaiveNg:
Your idea is vague; it's not clear what you want to do. Normally an SMS API should have parameters to help you make requests. Simply use urlencode() function to encode the parameters you'll be sending to the URL.


please help me out with the urlencode. I need to implement it inside php

this below code work well but the problem is that i want to include session data from my sql database into that recipients instead,
but
$_SESSION['hl_user']['phone']; brings error.



// Account details
$username = urlencode('4RNNJFN@gmail.com');
$apiKey = urlencode('a4a2c93f419ae9RGNRJHRINIREc298');

// Message details
$sender = urlencode('Jims');
$messagetext = rawurlencode('messagehere');
$flash = urlencode('0');
$recipients = urlencode('2348154848494');



// Prepare data for POST request
$data = 'username=' . $username . '&apikey=' . $apiKey . "&sender=" . $sender . "&messagetext=" . $messagetext . '&flash=' . $flash . '&recipients=' . $recipients;

// Send the GET request with cURL
$ch = curl_init('http://api.bulkssms.com:8080/sendsms?' . $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);

// Process your response here
echo $response;
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by LaiveNg: 7:08pm On Aug 11, 2018
Ensure you add session_start() on the very top of the page you wish to use the session variables. And also, PHP session values are usually accessed using $_SESSION['your_key_here']; AND NOT $_SESSION['dummy_stuff']['your_key_here'].
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by fineboynl(m): 4:41pm On Aug 15, 2018
LaiveNg:
Ensure you add session_start() on the very top of the page you wish to use the session variables. And also, PHP session values are usually accessed using $_SESSION['your_key_here']; AND NOT $_SESSION['dummy_stuff']['your_key_here'].
i

yes, did that, i'm sure it need function. string, can you help me out with this. i have glo 1k for you.
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by LaiveNg: 5:21pm On Aug 15, 2018
Let me see your code and the error message being spit out. Whatsapp 09055589180 Voice call 07014509524.
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by fineboynl(m): 7:03pm On Aug 15, 2018
LaiveNg:
Let me see your code and the error message being spit out. Whatsapp 09055589180 Voice call 07014509524.
your last seen on WhatsApp was Sunday
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by LaiveNg: 9:00pm On Aug 15, 2018
fineboynl:
your last seen on WhatsApp was Sunday
That's not the issue. My replies on Whatsapp are only for important messages. I have replied yours.
Re: How To Break Down A Link In Php Code, & Call/include User Session Into The Link? by fineboynl(m): 9:03pm On Aug 15, 2018
LaiveNg:

That's not the issue. Reply only important messages. I have replied yours.
already open that in another thread and called you. open the thread

(1) (Reply)

You Cant Sell Adsense Again. Google Updates Policy / Your Advice Is Needed � - You Reading This Now / Get Your Affordable US Adsense Here.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 14
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.