Jump to content

Hoping for help with simple programming. Think it's PHP


Urup

Recommended Posts

I'm looking for some help with simple PHP coding, I think it's called . I process simple data from one program to another to display it on an info screen. I have some problems with setting up the setup itself which is a bit messy after many changes. Hope someone can make it together with me so it will be simpler to change. Simple things like margins and line breaks. Such simple data as this to be processed

<OmraadeRengoering Status="ok">
<Aktivitet>
<Tidsrum>01:10-23:00</Tidsrum>
<Navn>Engen</Navn>
<Kontaktgruppe>Christina S. og Peter</Kontaktgruppe>
</Aktivitet>
</OmraadeRengoering>

I know I just attach screen clips with why it is displayed incorrectly the messy code that has been written. However, it is with another link than the right one, as I do not want to write it here

https://drive.google.com/drive/folders/1Yw3OU642WLP_wQfgjiFlz7hc_gtye_BB?usp=sharing

Link to comment
Share on other sites

It's better to paste the (relevant) code, and/or screenshots for stuff that's visual, directly into your post: most people here try to keep safe and so won't download random files from strangers on the internet.

That stuff you included there is XML, and it's easy to read with PHP. But you're talking about margins and line breaks, which isn't actually PHP, though the line between what is and isn't PHP does get a little blurry sometimes.
Can you give a more detailed description about what you're doing, what you've written so far, what happens when you run it, and what you were expecting it to do instead? Remembering to post code as you go, of course.

  • Like 1
Link to comment
Share on other sites

Are you still with us? requinix is a pro. You are in good hands.

Meantime, margins is interesting because do you want margins or not? I see a double break after the body tag.

<body><br><br/>

incidentally, html5 does not require the ending slash. vide xhtml.

since you are already using css, why not add margin control?

<span style="font-family:'Comic Sans MS', Comic, Monospace; margin: 8px 8px">

the center tag is deprecated, is it not? Again, why not use css?

align: center; text-align: center;

let us know if you need further assistance. I will also post the entire script from the google drive link. I hope that it is okay to do so. Please forgive me if it is not okay to post the aftenrenlille.php code.

<?php ini_set('default_socket_timeout', 5); ?>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>AU-INFO</title>

        <style type="text/css">
        #dagensret{
//font-size:10px;            
        }
       .food{
 //           color: green;
font-size:15px;
        }        
        </style>
        
    </head>
    <body><br><br/>
    
 
<span style="font-family:'Comic Sans MS', Comic, Monospace">
<center>

<span style="font-size:25pt">


<?php
// 11
// remember to remove the ; from the beginning of extension=php_soap.dll in php.ini

   

$cli= new SoapClient('https://xxxxxxxxxxx.dk/SPService.asmx?WSDL');
   

//$res = $cli->__soapCall('DagensMenu',array());
// $xmlstr = $res->DagensMenuResult->any;
$simple = simplexml_load_string($xmlstr);
$text = $simple->Menu->Tekst;




echo "AFTENRENGØRING ";
echo $text."";
?>
<!--Overskrift-->
 <span style="font-size:10pt">
<!--Overskrift-->

<!--Vegatare-->
<span style="font-size:25pt">
<!--->
<?php

  
$simple = simplexml_load_file('https://xxxxxxxxxxx/SPService.asmx/AktuelleOmraadeRengoering');
$text = $simple->Aktivitet->Navn;

// slette + tegn AU
$text = str_replace('+', '', $simple->Aktivitet->Navn);      
echo $text;
?>
 
    </body>
</html>
<!--Menu herover-->


</html>

 

  • Great Answer 1
Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.