BullGuard Antivirus Sale - 60% Off with openElement !
Forum openElement Homepage
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: 28 Jan 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: 31 Jan 2020 at 22:11
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: 28 Jan 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: 31 Jan 2020 at 23:47
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: 30 Dec 2015
Location: Germany Frankfu
Status: Offline
Points: 652
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2020 at 13:58
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://digispics.com/_pers/resger2017.pdf
Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: 28 Jan 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: 01 Feb 2020 at 19:57
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: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5668
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: 01 Feb 2020 at 20:20
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: 28 Jan 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: 01 Feb 2020 at 20:59
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: 28 Jan 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: 01 Feb 2020 at 21:48
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: 05 Juin 2018
Location: Canada, Québec
Status: Offline
Points: 5668
Post Options Post Options   Thanks (0) Thanks(0)   Quote Hobby001 Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 2020 at 00:03
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 - 02 Feb 2020 at 07:09
Back to Top
Consult View Drop Down
Newbie
Newbie


Joined: 28 Jan 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: 02 Feb 2020 at 00:38
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: 30 Dec 2015
Location: Germany Frankfu
Status: Offline
Points: 652
Post Options Post Options   Thanks (0) Thanks(0)   Quote digizar Quote  Post ReplyReply Direct Link To This Post Posted: 02 Feb 2020 at 01:00
There is a french version of the forum, selectable in the rigth uper corner.

___________________________________
Ask questions only if there is no answer yet.
https://digispics.com/_pers/resger2017.pdf
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 10.11
Copyright ©2001-2012 Web Wiz Ltd.

This page was generated in 0,031 seconds.