-
Posts
783 -
Joined
-
Last visited
Everything posted by ZulfadlyAshBurn
-
make sure that admin/data.dat is available in your server. If not it wont work.
-
nothing is gonna happen unless you change to <form name="form1" method="post" action="check_login.php">
-
That would make it more difficult if the users are using dynamic ip. Only some users use static ip. Try something else like logging in or session id
-
did you put you semicolon at the end? Line 23: $error = "Bad Login";
-
ok, use this instead if(!isset($_SESSION['username'])){
-
ok. then change //check if logged-in if not echo login form if(!session_is_registered(username)){ to //check if logged-in if not echo login form if(!isset(username)){
-
change it to this code <?php //starts session session_start(); //check if logged-in if not echo login form if(!session_is_registered(username)){ echo "<form action='login.php' method='post' name='login'> Username:<input name='username' type='text' value=''> Password:<input name='password' type='password' value=''><input name='Submit' type='submit' value='SUBMIT!' style='width:100; text-align:center; border-color:#F00; background-color:#FFF'><input name='Register' type='button' value='Register' style='width:100; text-align:center; border-color:#F00; background-color:#FFF'> </form>"; } // if user logged in, then echo welcome, username else { echo "<center> Welcome, "; echo($_SESSION['username']); echo "</center>" } ?> if you want to the user to be redirected to the previous page if not logged in, the change echo "<form action='login.php' method='post' name='login'> Username:<input name='username' type='text' value=''> Password:<input name='password' type='password' value=''><input name='Submit' type='submit' value='SUBMIT!' style='width:100; text-align:center; border-color:#F00; background-color:#FFF'><input name='Register' type='button' value='Register' style='width:100; text-align:center; border-color:#F00; background-color:#FFF'> </form>"; with header("location:index.php");
-
sorry but is it possible if you can translate your words into english? that would makes it easier for us to read and figure out what is wrong in your code
-
Photo Upload Direction and Support Please
ZulfadlyAshBurn replied to fizzzgigg's topic in PHP Coding Help
I have created something that might help you. but the thing is that it does not affiliate to any student id. you will need some code for that. cms.php <?php echo "<form enctype='multipart/form-data' action='upload.php' method='POST'>Choose a file to upload: <input name='uploadedfile' type='file' /> <input type='submit' value='Upload File' /> </form>"; $buildhtml = ""; $dirpath = "files/"; $dlist = opendir($dirpath); while ($file = readdir($dlist)) { if (!is_dir("$dirpath/$file")) { // assuming that all the files are image files // when admin click the photo, it will delete the photo $buildhtml .= "<img src=files/$file onClick='unlink(files/$file);'></img><br>"; } } closedir($dlist); if (!empty($buildhtml)) { echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>"; echo "Click on it to download"; } else { echo "The directory is <strong>empty</strong>! Upload the files by using the form above."; } upload.php <?php // Created by ZulfadlyAshBurn header('Refresh: 3; URL=index.php'); // you have to create a folder named files and it should have 777 permissions. $target_path = "files/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> show.php <?PHP // Created by ZulfadlyAshBurn $buildhtml = ""; $dirpath = "files/"; $dlist = opendir($dirpath); while ($file = readdir($dlist)) { if (!is_dir("$dirpath/$file")) { // assuming that all the files are image files $buildhtml .= "<img src=files/$file></img><br>"; } } closedir($dlist); if (!empty($buildhtml)) { echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>"; echo "Click on it to download"; } else { echo "The directory is <strong>empty</strong>!"; } ?> you may want to put this (show.php) file in the main page. as you can see, the cms i add in unlink for the admin to be able to delete the photo but at the show pg, the viewers are only able to see but not delete. you can secure you cms.php with some mysql and php. -
You will need to have a static ip to make it work. On the client backend, look for Remote Database Access Hosts then insert your static ip. if Remote Database Access Hosts is not there, contact the tech support and ask them to ass your ip to the Remote Database Access Hosts
-
maybe that will solve the prob
-
do you mind if you screenshot your database?
-
try this. it might work. hopefully <?php if (!($order_code)){ include 'page.php'; ?> <body onLoad="document.forms.order.cust_code.focus();"> <p class="text"><form action="<?php echo $_SERVER['PHP_SELF']?>" method="post" enctype="application/x-www-form-urlencoded" name="order" id="order"> Κωδικός Πελάτη <br /> <input name="cust_code" type="text" size="7" maxlength="7" id="cust_code" <?php if (isset($_POST['cust_code'])) { echo 'value="'.$_POST['cust_code'].'"'; } ?>/> <br /> Κωδικοί Παραγγελίας<br /> <input name="order_code" type="text" size="5" maxlength="5" id="order_code" <?php if (isset($_POST['order_code'])) { echo 'value="'.$_POST['order_code'].'"'; } ?>/> <br /> <br /> <img src="GenerateCaptcha.php?width=150&height=35&chs=5&font=AmericanParticipants"/> <br /> <input name="providedCaptcha" type="text" size="19" maxlength="5" id="providedCaptchaId" /> <a href="javascript:ajaxpage('pelatis.php', 'content');"><input name="Submit" type="submit" id="button" onclick="this.form.post" value="Submit" /></a> </form></p> </body> </html> <?php echo "<font color=#00FFFF><font size=4><font weight=bold>Παρακαλώ εισάγετε τουλάχιστον μια (1) παραγγελία!</font></font></font>"; exit(); } ?>
-
thanks alot. i works
-
actual file http://zulfadlyashburn.com/ons/index.php after edited http://zulfadlyashburn.com/ons/index2.php
-
the page still fails.
-
when the user save, it saves the file but when it is viewed, it looks different o.0 edit.php <?php $file = file_get_contents ('index2.php', true); ?> <html> <head> <title>Editor</title> <script type="text/javascript" src="ckeditor/ckeditor.js"></script> </head> <body> <form method="post" action="save.php"> <p> My Editor:<br /> <textarea name="editor1"><?php echo htmlentities($file); ?></textarea> <script type="text/javascript"> window.onload = function() { CKEDITOR.replace( 'editor1' ); }; </script> </p> <p> <input type="submit" /> </p> </form> </body> </html> save.php <?php $editor_data = $_POST[ 'editor1' ]; $a = htmlentities($editor_data); $b = html_entity_decode($a); $fileurl = "index2.php"; $fp = fopen($fileurl, 'w'); fwrite($fp, $b); fclose($fp); ?>
-
ive got it. was quite a simple code. why didnt i think of tht. omg! <?php $file = file_get_contents ('index2.php', true); ?> <textarea name="content" cols="50" rows="15"><?php echo $file; ?></textarea>
-
how to i echo the source in to textarea? this is what i amble to docan you help me with the teaxtarea? <?php $file = file_get_contents ('index.php'); Echo $file; ?>
-
How do I build a Content Management System
ZulfadlyAshBurn replied to KDM's topic in PHP Coding Help
cms.php <?php echo "<form enctype='multipart/form-data' action='upload.php' method='POST'>Choose a file to upload: <input name='uploadedfile' type='file' /> <input type='submit' value='Upload File' /> </form>"; $buildhtml = ""; $dirpath = "files/"; $dlist = opendir($dirpath); while ($file = readdir($dlist)) { if (!is_dir("$dirpath/$file")) { // assuming that all the files are image files // when admin click the photo, it will delete the photo $buildhtml .= "<img src=files/$file onClick='unlink(files/$file);'></img><br>"; } } closedir($dlist); if (!empty($buildhtml)) { echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>"; echo "Click on it to download"; } else { echo "The directory is <strong>empty</strong>! Upload the files by using the form above."; } upload.php <?php // Created by ZulfadlyAshBurn header('Refresh: 3; URL=index.php'); // you have to create a folder named files and it should have 777 permissions. $target_path = "files/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> show.php <?PHP // Created by ZulfadlyAshBurn $buildhtml = ""; $dirpath = "files/"; $dlist = opendir($dirpath); while ($file = readdir($dlist)) { if (!is_dir("$dirpath/$file")) { // assuming that all the files are image files $buildhtml .= "<img src=files/$file></img><br>"; } } closedir($dlist); if (!empty($buildhtml)) { echo "Files in Storage</strong></u><p>" . $buildhtml . "</p>"; echo "Click on it to download"; } else { echo "The directory is <strong>empty</strong>!"; } ?> you may want to put this (show.php) file in the main page. as you can see, the cms i add in unlink for the admin to be able to delete the photo but at the show pg, the viewers are only able to see but not delete. you can secure you cms.php with some mysql and php. -
do you mind posting the url? maybe i could help
-
sorry but can you explain in detail what you need? where do you the design to be?
-
Ys, i have learnt php for quite a long time and have create a website using php, html and mysql. i want users to be able to edit their website source on my page. their code are hosted on the same server.
-
@Rifts I want to create something like that. I have tried many third party softwares but im still unable to achieve it @MrAdam What i meant is that they are able to upload their own files and edit them (the files uploaded) on the website itself as a whole source using third party software like tinymce.
-
i am currently creating a school portal. there is this page which enables user to create their own website for Computer Education lesson. Every user are able to upload their files and view but the problem is, i need a function for the user to be able to edit it in on the page itself.