BullGuard Antivirus Sale - 60% Off with openElement !
Forum Home Forum Home >

openElement

> Dynamic OE - Databases, etc
  New Posts New Posts RSS Feed - OE and Mysql
  FAQ FAQ  Forum Search   Register Register  Login Login

OE and Mysql

 Post Reply Post Reply Page  <123>
Author
Message
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Jan 31 2020 at 9:11pm
Than you.  Another thing i didn't know. Here it is :

Uncaught SyntaxError: Unexpected token '<'                                        in index line27
/favicon.ico:1 Failed to load resource: the server responded with a status of 404 (Not Found)
(index):1 A cookie associated with a cross-site resource at http://cogupo.piyugahevo.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.


OK, apparently there is a mistake in index.htm line 27, I will try to correct it, and then I will come back to you with the result.
Thanks a lot for your info and the time you put into it

Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Jan 31 2020 at 10:47pm
I corrected the item listed above.
Now only the text starting with /favicon.ico and further is displayed.  No other result was seen.

Back to Top
digizar View Drop Down
Senior Member
Senior Member
Avatar

Joined: Dec 30 2015
Location: Germany Frankfu
Status: Offline
Points: 738
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 12:58pm
Although I am not directly involved in this thread, the < error looks like one of the previous lines (before 27) be the colprit. It is hard to guess if there is no example, at least a screen shot or some link.
Usually one should be careful with some (special) characters as > [ < ] ...
___________________________________
Ask questions only if there is no answer yet.
https://blumendigi.com
Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 6:57pm
Thank you Sir, for your comment. I removed those character allready, but still no result.
I'm thinking now that the reason while my code is not working from a html page in OE, is because the code I listed earlier is in a php file. I read on posts on other forums that you have to run ajax and use jquery and json to display mysql query data in a html webpage.  That's probably also the reason why my code is working fine when I call it's php file directly from the browser.  I tried to call it from within a html file and it did'nt work.  So probably the solution will be there somewhere.
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6194
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 7:20pm
Have you switched your page to php?

Page Tab, Properties, Extension, select php



I could transfer data php to/from javascript 


//
// editeur.php
//

$uploads_dir = "uploads/";
nettoyage($uploads_dir);

// Dossier de mise de côté et début du nom du fichier mis de côté
$miseDeCote = "../imagesRetirees/" . 'image-' . date('Y\-m\-d H:i:s').'-';
$miseDeCote = str_replace(':','',$miseDeCote);
$miseDeCote = str_replace(' ','',$miseDeCote);

// Donnée reçue
$fichierImage = htmlspecialchars($_POST['fileToManage']);
// ------------------------------------------------------------------
// Traitement de l'image
// Nom du fichier image à traiter
$fichierImage = str_replace("/_thumbnails","",$fichierImage);
// Extraire le nom du fichier image
$filepath = pathinfo($fichierImage);
// créer un nouveau nom de fichier
$imageToEdit = $filepath['basename'];
if (substr($imageToEdit,0,5)=='image'&&(strlen($imageToEdit)>23)){
$imageToEdit = substr($imageToEdit,23);
}
// copier en renommant le fichier dans le dossier uploads
copy ($fichierImage, $uploads_dir . $imageToEdit);
// copier le fichier image dans le dossier de mise de côté (backup) sans le renommer
copy ($fichierImage, $miseDeCote . $filepath['basename']);

// ------------------------------------------------------------------
// capture de l'extension du fichier image
$exten = $filepath['extension'];
// capture de la galerie
$galerie = strpos($fichierImage, 'Chevaux');
if ($galerie > 1){
$galerie = '.chevaux';
} else {
$galerie = '.autres';
}

// ------------------------------------------------------------------
// Traitement du texte
// Extraire le nom du fichier texte
$fichierTexte = str_replace($exten,'txt', $fichierImage);
$filepath = pathinfo($fichierTexte);
// copier le fichier texte dans le dossier de mise de côté sans le renommer
copy ($fichierTexte, $miseDeCote . $filepath['basename']);

// lecture du titre et de la description
$contenu = file_get_contents($fichierTexte);
$contenu = str_replace(array(Chr(13), Chr(10)), '', $contenu);

$PositionDescription=strpos($contenu,"description");

$titre=substr($contenu,6,$PositionDescription-6);
$description=substr($contenu,$PositionDescription+12);

?>

<br>
<script type="text/javascript">
$(function(){
var $Fichier = "<?php echo $fichierImage ?>"; 
var $Titre = "<?php echo $titre ?>";
var $Descr = "<?php echo $description ?>";
var $gal = "<?php echo $galerie ?>";
$(".imageCible").attr("src",$Fichier);
$('input[name="titre"]').val($Titre.trim());
$('#description').val($Descr.trim());
$($gal).trigger('click');
});
</script>

<?php

function nettoyage($target_dir){
chdir($target_dir);
// liste les fichiers de texte dans le dossier
$files = glob('*.*');
foreach($files as $file){
unlink($file);
}
chdir('..');
}


Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 7:59pm
No i did not change to php.  Maybe that is it what is wrong all the time, because when i run my code outside OE it is in a php file.  Thanks a lot for the info and the code example you sent me. You're amazing. I will give it another try during the WE and I will let you know.
Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 8:48pm
I'm sorry to say, in my version of OE under Page Tab, i can find properties, and under that there is no option to change the file extension.  I'm using OE 1.57 R9
Back to Top
Hobby001 View Drop Down
Admin Group
Admin Group
Avatar

Joined: Jun 05 2018
Location: Canada, Québec
Status: Offline
Points: 6194
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 11:03pm
Sorry, I poorly tried to translate from French to English.  

I just switched OE from French to English.

Page tab, server scripts, php



Edited by Hobby001 - Feb 02 2020 at 6:09am
Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: Jan 28 2020
Location: Belgium
Status: Offline
Points: 13
Post Options Post Options   Thanks (0) Thanks(0)   Quote Consult Quote  Post ReplyReply Direct Link To This Post Posted: Feb 01 2020 at 11:38pm
Ah, there.  OK thank you, i'll give it a try.  Vous êtes francophone peut-être?  Si vous préferez de converser en français c'est bon pour moi aussi. En Belgique on parle un peu les deux : le néerlandais et le français, comme au Canada, le français et l'anglais. Merci quand-même.
Back to Top
digizar View Drop Down
Senior Member
Senior Member
Avatar

Joined: Dec 30 2015
Location: Germany Frankfu
Status: Offline
Points: 738
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: Feb 02 2020 at 12:00am
There is a french version of the forum, selectable in the rigth uper corner.

___________________________________
Ask questions only if there is no answer yet.
https://blumendigi.com
Back to Top
 Post Reply Post Reply Page  <123>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.063 seconds.