ค้นหาฝ่ายสนับสนุน

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

เรียนรู้เพิ่มเติม

php script does not work as autoadmin.global_config_url

  • 11 การตอบกลับ
  • 1 คนมีปัญหานี้
  • 1 ครั้งที่ดู
  • ตอบกลับล่าสุดโดย jscher2000 - Support Volunteer

more options

hello, in mozilla.cfg i specify (local apache server is running): pref("autoadmin.global_config_url", "http://localhost/php/auto.php?u=1");

and auto.php looks something like this (just an example):

as a result i obtain the message added as image. mostly you find that people use a javascript file for "autoadmin.global_config_url", but i know of others who use a php-file. Does someone have an idea what i am doing wrong? some setting in config? thank you very much!

hello, in mozilla.cfg i specify (local apache server is running): pref("autoadmin.global_config_url", "http://localhost/php/auto.php?u=1"); and auto.php looks something like this (just an example): <?php $uid = $_GET["u"]; if ($uid == "1") {echo 'pref("browser.startup.page", 1)'; } else {echo 'pref("browser.startup.page", 0)'; }; ?> as a result i obtain the message added as image. mostly you find that people use a javascript file for "autoadmin.global_config_url", but i know of others who use a php-file. Does someone have an idea what i am doing wrong? some setting in config? thank you very much!
ภาพหน้าจอที่แนบมา

วิธีแก้ปัญหาที่เลือก

Okay, you cannot add parameters to the URL directly; the URL is truncated at the question mark. Please see the following articles for a workaround:

อ่านคำตอบนี้ในบริบท 👍 0

การตอบกลับทั้งหมด (11)

more options

i add the script once more as an image.

more options

the images are poor, i am sorry. don't know how to upload them with higher resolution.

more options

First, is PHP running on localhost? What if you load that URL in a Firefox tab -- what does the response look like? If PHP is not running, you would expect right-click > View Page Info to show "text/plain" as the content type.

Second, if PHP is running, you might see the content type "text/html". To resolve that, specify a JavaScript content-type. For example:

<?php header('Content-Type: application/x-javascript; charset=utf-8'); $uid = $_GET["u"]; if ($uid == "1"){ echo 'pref("browser.startup.page", 1)'; } else { echo 'pref("browser.startup.page", 0)'; }; ?>

more options

By the way, you need to use the HTML entity &lt; in place of < to prevent the forum from eating your code.

more options

i think i found out that the line $uid = $_GET["u"]; is the problem. If instead i say $uid = 1; it works. but how can this be? looks as if 'he' interprets some character as '<' .. how can i read the url-search part?

เปลี่ยนแปลงโดย carpinus เมื่อ

more options

Hi carpinus, is Firefox not passing the query string on the URL? If you echo the entire query string, is it there?

more options

hi, sorry but i do not know how to ... if i code in auto.php < ?php $que = $_SERVER["QUERY_STRING"]; echo $que; and in the location bar i enter localhost/php/auto.php?u=a .. then 'u=a' will appear. fine. but echo does not work the same when the containing script is called on firefox startup may be there is a way to echo to console or to some error log entering the sript on the urlbar with ff already running also $_GET() works fine.

just tried the following in auto.php:

<?php $fp = fopen("messages.txt","w"); $que = $_SERVER["QUERY_STRING"]; fwrite($fp, $que); $req = $_SERVER["REQUEST_URI"]; fwrite($fp, $req); fclose($fp);

and a file messages.txt appears, but it only contains the URI, without the search string

เปลี่ยนแปลงโดย carpinus เมื่อ

more options

วิธีแก้ปัญหาที่เลือก

Okay, you cannot add parameters to the URL directly; the URL is truncated at the question mark. Please see the following articles for a workaround:

more options

yet .., $_GET() still doesnt work, strange

thank you for your information! should have come across that myself ..

would you like to have a look at my other question (1130736)? (from the fact that a refresh resolves the problem i conclude that places.sqlite is not damaged in my case)

เปลี่ยนแปลงโดย carpinus เมื่อ

more options

I have unmarked the solution that makes it more likely jscher2000 will see your additional post. You may mark is as solved again if appropriate as soon as he posts back.

Your other posts are

more options

I looked at the other thread and didn't really have any new ideas.