Jump to content

kraziekris

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

kraziekris's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi i am trying to connect to a mysql thats installed on my server i made a script called sqltest.php with <html> <head> <title>MySQL Test</title> </head> <body> <h1> <?php $connection=mysql_connect("localhost","root","8119604") or die("Could not connect to MySQL"); echo "Successfully connected to MySQL"; ?> </h1> </body></html> its held at http://beta.mauritiusnews.co.uk/testsql.php if you click you will see the error i get: Fatal error: Call to undefined function mysql_connect() in D:\Inetpub\wwwroot\BETA\testsql.php on line 5 i dont know why my php.ini seems to have the correct extentions???? Thanks Chris
  2. Hi again im here as im new to PHP I have a page which pulls code from a mysql database and have an include file which gets all the data ready!!! Which i include the file i just get a blank page, no errors nothing! http://beta.mauritiusnews.co.uk how am i supposed to find out what i have done wrong if i just get this with no errors? is there a way to errorlog? the pages code is attatched, it did work on another server but on this one it does not, i thought maybe somethings not enabled that should be? I dont really think the code is wrong but the real question is how do i find why im getting a blank page and when i remore the include to this file the page displays! Thanks [attachment deleted by admin]
  3. Thats absolutly brilliant guys thanks so much for your help this has solved the problem straght away! is register_globals a bad thing i was told this should be set to off in most cases. When writing PHP code in the suture is there a rule to stick by to no need this switched on? Thanks Again!
  4. Hi guys been looking at this forum and it looks like it could be what i need, im new to php and have just taken on a website with some pages using it! I think it was installed on a PHP 4 server as when we have just moved the site to a php5 server the code stopped working I looked throught the pages and the code started with <? as soon as i changed it to <?php it all started looking better, is this normal? Next i have this page <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <?php session_register("GlimpseDir"); if(!$GlimpseDir) $GlimpseDir="/"; $basedir="images/pics/"; function reloadnow() { global $PHP_SELF; global $addons; header("Status: 302 Moved"); header("Location: $PHP_SELF".$addons); exit(); } if($cancel) $action=""; if($action=="root") $GlimpseDir="/"; if($action=="chdr") $GlimpseDir=$file."/"; if($action=="dele" && $confirm==1) { unlink($basedir.$file); $action="";} if($action=="move" && $confirm && $newfile) { rename($basedir.$file,$basedir.$newfile); $action=""; } if($action=="rmdr") rmdir($basedir.$file); if($action=="edit" && $confirm && $file) { $fp=fopen($basedir.$file,"w"); fputs($fp,stripslashes($code)); fclose($fp); $addons="?action=edit&file=".rawurlencode($file); reloadnow(); } if($upload) { copy($userfile,$basedir.$GlimpseDir.$userfile_name); reloadnow(); } if($touch) { touch($basedir.$GlimpseDir.$touchfile); reloadnow(); } if($mkdir) { mkdir($basedir.$GlimpseDir.$mkdirfile,0700); reloadnow(); } ?> <HTML> <HEAD> <TITLE>Image Upload to "<?php echo $GlimpseDir;?>"</TITLE> <link rel="stylesheet" type="text/css" href="./css/stylesheet.css" /> </HEAD> <BODY> <table width="80%" border="0" align="center" valign="top" bgcolor=#FFFFCC> <tr align="left" bgcolor="#009900"> <th><a class="header" href="./BackOfficeHomepage.asp">Articles Manager</a></th> <th><a class="header" href="./BackOfficeAdverts.asp">Adverts Manager</a></th> <th><a class="header" href="./BackOfficeSections.asp">Sections Manager</a></th> <th><a class="header" href="./FrontPage.asp" target="_blank">View Website</a></th> <th><a class="header" href="./BackOfficeLogin.asp">Log Out</a></th> </tr> <?php if ($action=="dele") { echo "<tr><td colspan=5>Are you sure you want to delete $file ?<BR>"; echo "<A HREF=\"$PHP_SELF?action=dele&file=" . rawurlencode($file) . "&confirm=1\">YES</A><BR>"; echo "<A HREF=\"$PHP_SELF\">NO</A><BR>"; echo "</td></tr></table></BODY></HTML>"; exit(); } ?> <tr><td colspan=5> </td></tr> <tr><td colspan=5><font color="#008000" size="3"><b>Upload to the <font color="#FF0000">Article</font> Image Folder</b></font></td></tr> <tr><td colspan=5>Please ensure that the images uploaded are in .jpg or .gif format only and are of a suitable size</td></tr> <tr><td colspan=5> </td></tr> <tr><td colspan=5> <TABLE BORDER="1" align="center" bordercolor="#008000" width="80%"> <TR align="left"><Th width="50%">Filename</TD><Th width="10%">Type</TD><Th width="10%">Size</TD><Th width="30%" colspan="2">Action</TD></TR> <?php $handle=opendir($basedir . $GlimpseDir); while($file = readdir($handle)) { if ($file != "." && $file != "..") { $filename=$basedir.$GlimpseDir.$file; $fileurl=rawurlencode($GlimpseDir.$file); echo "<TR>"; echo "<TD>" . htmlspecialchars($file) . "</TD>\n"; echo "<TD>" . filetype($filename) . "</TD>\n"; echo "<TD>" . filesize($filename) . "</TD>\n"; //echo "<TD>"; if(filetype($filename)=="file") { echo "<TD><A HREF=\"$basedir$file\" target='_blank'>View File</A></TD>"; echo "<TD><A HREF=\"$PHP_SELF?action=dele&file=$fileurl\">Del File</A></TD>"; } if(filetype($filename)=="dir") { echo "<TD><font color='#000080'><A HREF=\"$PHP_SELF?action=chdr&file=$fileurl\">Change Dir</A></font></TD>"; echo "<TD><font color='#000080'><A HREF=\"$PHP_SELF?action=rmdr&file=$fileurl\">Remove Dir</A></font></TD>"; } //echo "</TD>"; echo "</TR>\n"; } } closedir($handle); ?> </TABLE> </td></tr> <BR> <tr><td colspan="5" align="center"> <FORM ENCTYPE="multipart/form-data" METHOD="POST" ACTION="<?php echo $PHP_SELF;?>"> <INPUT NAME="userfile" TYPE="file"> <INPUT TYPE="SUBMIT" NAME="upload" VALUE="Upload File"><BR> <INPUT TYPE="TEXT" NAME="mkdirfile"> <INPUT TYPE="SUBMIT" NAME="mkdir" VALUE="Make New Directory"><BR> </FORM> </td></tr> </table> </BODY> </HTML> I have had to make a few more changes to get it to work but it still does not and wondered is there anything obvious anyone can see which would stop it? The problem im having with it is it does not actually do anything it should apart fromlist the directory, it wont upload or create and new folder.. If you go to the URL http://www.mauritiusnews.co.uk/UploadPicsImg.php you can see it working, i have noticed if you click a command like DEL picture this then becomes the SELF. Very strange stuff. Thanks
×
×
  • 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.