Questions tagged [external-php-scripts]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
38 views

How to send POST request using \Drupal::httpClient()

Running on Drupal 8. I am trying to POST to an email form (so it may be their API), but I believe my issue is attaching JSON data onto my post request before sending it. My error log is: Uncaught ...
0
votes
0answers
19 views

How can I use a conditional statement to display field collection items? [duplicate]

I have a field collection with 3 fields. The max limit of the filed array is 3. What I want is checking filed value and display them according to the following conditions. if the fiel[0] has value ...
1
vote
0answers
30 views

Checking if user logged-in by external script, fails

With a script on an external webpage (same domain), I need to detect whether the user that's visiting the page is or not logged in. [EDIT] This occurs when the script is into a subfolder. If it's put ...
0
votes
1answer
12 views

Migrated Servers now 500 Error _db_error_page('Access denied f…')

Moved servers, copied all files and database and set server settings to match old server. Updated settings.php with new database credentials and tripled checked them for the correct information. ...
0
votes
1answer
67 views

How do I render the main navigation menu?

In Drupal 7, we were able to render the main navigation menu onto a page outside the main Drupal folders by including bootstrap.inc and displaying it with this code. $menuData = menu_tree_output(...
2
votes
1answer
79 views

Execute custom php to manage click2call

I need to POST to a url with php code in order to make a phone call. This is an example of javascript: <script> function callme() { var XHR = new XMLHttpRequest(); ...
0
votes
1answer
128 views

How can I bootstrap?

How can I bootstrap Drupal 8 from an external script? This an example script from the RabbitMQ Work Queues tutorial. require_once __DIR__ . '/vendor/autoload.php'; use PhpAmqpLib\Connection\...
0
votes
1answer
32 views

Is it possible for 3rd Party Script to Create Users [closed]

Our company has many systems that require for users to have user names and passwords. We have been able to use SAML to cut down on the number of accounts we must manually create. With that said, we ...
0
votes
0answers
21 views

Ascertaining logged in user by Drupal8 API

I would like to be able to get the currently logged-in user by using only the Drupal8 API from some standalone PHP code. I have tried various URLs in the following code without success curl_setopt($...
0
votes
2answers
79 views

Moving the fields and data from one content type to another content type in drupal-7

I have created a content type called "ContentA" and in that content type I have two fields, "Summary" and "Title". I have already created a new content type called "ContentB" and it is also having the ...
0
votes
0answers
159 views

Running a PHP script with Elysia CRON

I want to automatically run a PHP script every 3 hours or so. The script is pretty heavy. It pulls XML data from another website then encodes it into a JSON file to be imported by feeds. The ...
0
votes
1answer
129 views

Bootstrapping a Drupal 8 Subsite

It's possible to bootstrap Drupal 8 and create a new node using answer # 174474. define('DRUPAL_DIR', '/usr/share/nginx/html'); use Drupal\Core\DrupalKernel; use Symfony\Component\HttpFoundation\...
2
votes
2answers
453 views

Load node entity from external script with image URI

I'm attempting to grab a node from a node ID in an external php script. With Drupal 7 I used the bootstrap.inc but with Drupal 8 this are a bit different. I've called Drupal with: define('...
2
votes
1answer
2k views

how to include external php file in drupal 8 [closed]

I want to merge two xlsx file and download merged file in drupal 8. So i used a PHPExcel library for doing so. But i am not able to include a PHPExcel.php file in custom controller for that. I used ...
1
vote
0answers
41 views

Posting Data to an external site using APIs

I've been tasked with posting information from our website to recreation.gov, using their API http://usda.github.io/RIDB/ Is there a specific way using any sort of drupal module or built in PHP with ...
0
votes
1answer
32 views

PHP filtered page is cached

With a few years of Drupal 6 and 7 experience, I've happily made my first Drupal 8 installation. In my previous installations of Drupal I've used custom made PHP code that does a lookup in a personal ...
-1
votes
1answer
359 views

How to insert PHP code into the Drupal 7 block with PHPFilter to enable a html form working?

<form action="run_pipeline.php" method="post"> Insert SRA identifier <input type="text" name="email"><br> <input type="submit" value="Run data processing pipeline"> </form&...
2
votes
1answer
41 views

How to mass copy the title of each node to a taxonomy term?

I need to copy the title of nodes to its taxonomy term. I have the following content type Title - text Body - text Taxonomy term - (currently empty) I want to copy the "Title" ---> "Taxonomy term" ...
2
votes
1answer
29 views

how to tell which book node is the root node programatically [closed]

If I have some nodes that are of type book, how can I go through them in a php script and tell which is the root? thanks
1
vote
0answers
20 views

Creating an API monitoring notification service using Drupal [closed]

I'm looking to create a monitoring/notification service using Drupal as the backend. I have the following api services and I want to get an email for everytime something changes: Twitter API Stock ...
0
votes
3answers
282 views

How do I access the Drupal class from a standalone PHP file?

How do I use the \Drupal class in an standalone PHP file?
2
votes
0answers
41 views

Sharing data in the same database, being able to edit data

I am looking for a way for Drupal to be able to access and modify data in an external table in the same database. Both Drupal and the script need access to the same data. Duplicating/Migrating is ...
0
votes
2answers
38 views

Kill border by using PHP?

In my theme on Drupal 7:50 there is #banner just beneath #menu. For #banner I have made {border-bottom:5px solid blue} The problem is that sometimes #banner is empty and then the #border remains and ...
2
votes
1answer
1k views

What is the best (secure) way to run PHP code on a Drupal 8 system?

I am pretty new with Drupal. I have installed Drupal 8.17 on my webserver and now I am configuring it. It runs on Ubuntu 16.04 with Apache 2.4 and PHP-7.0, the DBMS is PostgreSQL 9.5. I would like ...
-2
votes
1answer
62 views

Creation of a Content Type to Meet Required Use Case

How do I achieve the following Use Case? Use Case Example Widgets, Inc. offers franchising opportunities. They have 3 different franchising levels (bronze, silver and gold). Widgets, Inc. needs to ...
0
votes
1answer
40 views

Running Drupal API Scripts offline

I want to run some maintenance scripts against a Drupal 7 system. These scripts will call the Drupal API to use things like EntityFieldQuery, node->save and so on. I could create a module called ...
2
votes
1answer
1k views

How do I check the current user session?

In Drupal 7, I was able to use bootstrap.inc in an external PHP script, which was a custom set of pages that simply bootstrapped Drupal to check the user was logged in Drupal. The following code is a ...
1
vote
1answer
178 views

Is it possible to have an external script run index.php that bootstraps Drupal?

It seems like such a simple question, and I apologize for my Drupal ignorance, but I am unable to get our Drupal contractors to accomplish what seems to be a simple request. I need the below script ...
0
votes
1answer
731 views

How to use drupal login for an 'external' application?

Long ago I built a php based application for room reservations which basically ran on its own – outside the website's CMS. It was part of what I would now call a custom made intranet – or "custom-app"....
2
votes
2answers
885 views

How to store a single array value into a session variable? [closed]

I have Array ( [0] => cid [1] => TN201501HP ) Now I want to store "TN201501HP" into some session variable. How to store this value to a session variable?
0
votes
2answers
95 views

Is a MySQL statement from an external script possible?

I'm working with a PM on a Drupal project, and we're having little success finding a developer to answer (what we believe to be) a simple question. I'm afraid I have no Drupal experience to speak of. ...
10
votes
3answers
5k views

Bootstrap from external script

I am trying to create Drupal entity instances from an external script that is not part of Drupal or a Drupal module. For Drupal 7 there was drupal_bootstrap to load the required Drupal dependencies. ...
1
vote
1answer
104 views

Access to other custom php pages

I am new to Drupal, so please bare with me. I have a Drupal site that is working fine. Now what I want to do is allow access to folder which contains some custom php script. I tried to put the ...
-2
votes
1answer
138 views

Is this way safe to bootstrap Drupal from an external PHP script? [duplicate]

I want to bootstrap Drupal from an external PHP file located in Drupal's root directory. The following code will do the job. error_reporting(E_ALL); ini_set("display_errors", 1); define('DRUPAL_ROOT',...
0
votes
1answer
37 views

Multilanguage Website

I'm trying to run some script from Pinterest, to validate my site. What's happenning is I need to write in Pinterest the url of my site, but my site redirects always like this : "XXX.com/es". How can ...
0
votes
0answers
29 views

Webform mail sending is successful but message says otherwise [duplicate]

I have this webform for contact. The site uses phpmailer 7.x-3.x-dev and library 5.2.9. When the webform is submitted, I get the error : Unable to send e-mail. Contact the site administrator if ...
0
votes
0answers
42 views

Prevent image uploads with embedded code

I have a site which allows anonymous users to create a node with an image (the site allows people to submit images with quote memes so that the authenticity of the quote can be verified, quotefail.com)...
-1
votes
2answers
2k views

How do you get DRUPAL_ROOT when using it in a separate php file?

It has been covered many many times on several sites, explaining how to define DRUPAL_ROOT and bootstrap the page (whatever that actually means). However no one has ever said how to use it in a ...
0
votes
1answer
1k views

How to include an external PHP script?

I have PHP file and I need to include that PHP file in static page. Where is best place to store that PHP file so I can include it in a static page.
0
votes
1answer
122 views

Placing a drupal menu on an external site

I have a drupal install (latest 7.x version at the time of writing). It is in the root directory of my domain. In a non drupal sub-directory, called 'member' so at /member, I have 3rd party script ...
1
vote
2answers
624 views

Getting “Fatal error: Class not found” by bootstrapping external script and executing user_save function

I have a problem i've struggled with for a long time, and it's starting to really piss me off, so i hope you can help me. The thing is i'm writing a custom script (not a module) that needs access to ...
0
votes
1answer
131 views

Accessing variable_get when loading bootstrap from an external file

I am loading the core drupal 7 components through an external file by loading bootstrap. While the core drupal functions work properly, when I try to access variable_get I keep getting the default ...
2
votes
0answers
123 views

Returning the userId from an external script

I have a very simple external php script which will not return the userId. The script is posted below: <?php include_once "/includes/bootstrap.inc"; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); global ...
0
votes
2answers
88 views

Create a script page for handling ajax

I am a bit confused on the appropriate way to generate a drupal page for handling ajax posts. For example I'm creating a custom module that has favorites buttons. When a user clicks the button the ...
2
votes
3answers
1k views

Show a PHP page in drupal 7

I have a php script that does some querying and book keeping of drupal tables. How can I run this php script directly from the url? The script uses drupal functions so I guess it should be aware of ...
0
votes
1answer
47 views

How to create a script file

I want to create a script file that I can call using a form on submit. For example I can use: action="action.php?uid=1&method=deleteuser" This would trigger the script to result in the function ...
0
votes
1answer
1k views

Submit to external url via Ajax & get return

I need a Drupal form to submit a file to an external server using ajax. I have done the form using Form API and I am able to submit it via Ajax, But the Drupal throbber never stops and I am not able ...
0
votes
0answers
69 views

Inserting user registration fields for app development

I need to insert the value as below.. but not working.. $fields['field_clinic_hospital_location_d']['und'][0]['field_telephone_number']['und'][0]['value'] = $telnum; I am inserting the user ...
1
vote
2answers
606 views

How to generate content to Drupal 7 with a PHP-script?

I have been given the task to generate a couple of thousand of pages in drupal that should contain text generated by a php-script. After that is done, I'm supposed to perform searches on the generated ...
2
votes
0answers
319 views

External script fails to load all drivers

Attempting to create an external script that allows me to query some things in Drupal. I was hoping to be able to use my external databases I have defined in the settings of my site to query some of ...