Jump to content

syntax help with variable


tomdchi

Recommended Posts

I have a script that contains:

 

$systemurl = $_POST['systemurl'];

 

this would be just https://domain.com/

 

later I have:

 

$url = "https://domain.com/includes/api.php";

 

How would I change one of these so that $url would get info from $systemurl and also have /includes/api.php-i.e.,

 

$url = {$systemurl}includes/api.php

 

I have this script working with $url domain completed but this will be used for more than one domain so I need it to pull from the post variable.

Link to comment
https://forums.phpfreaks.com/topic/133663-syntax-help-with-variable/
Share on other sites

The variable in question is from a post that contains the system url not of my server but a remote server from where the post came from.  This script uses curl to talk back to the remote site hence the need for it to know where it originated from.

 

When I use $url = "https://remotedomain.com/api.php"; it works fine but I need it to get the url information from the $systemurl variable and append it with /api.php so I can use this script for more than one domain.  Can this be done?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

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.