Jump to content

Iryk

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Contact Methods

  • Website URL
    http://majestic-neo.com

Profile Information

  • Gender
    Not Telling

Iryk's Achievements

Member

Member (2/5)

0

Reputation

  1. i got it fixed. Thanks for your guys' help ;)
  2. I have rewritten my code partially... [code]<?php   $db_username = $_POST['db_username'];   $db_password = $_POST['db_password'];   $db_host = $_POST['db_host']; $connect = mysql_connect("$db_host","$db_username","$db_password") or die("<center><span style='color: red; font: 8pt verdana'>Database information is wrong. Please go back and retype the information.</span></center>"); if ($your_password != $retype_password) { echo "<center><span style='color: red; font: 8pt verdana'>Your passwords do not match. Please go back and retype the information.</span></center>"; } else { $dat = date("D j M, Y"); $title = $_POST['site_title']; $description = $_POST['site_description']; $copyright = $_POST['site_copyright']; $url = $_POST['site_url']; $banner = $_POST['site_banner']; $username = $_POST['your_username']; $password = md5($_POST['your_password']); $location = $_POST['your_location']; $email = $_POST['your_email']; $avatar = $_POST['your_avatar']; $website = $_POST['your_website']; $signature = $_POST['your_signature'];       $installed = '$installed';       $new_content = "<? " . $installed . " = 'yes'; mysql_connect('" . $db_host . "','" . $db_username . "','" . $db_password . "'); ?>";       $file = fopen('../db_connect.php', 'a');       fwrite($file,$new_content);     fclose($file);       include("../db_connect.php");       mysql_query("INSERT INTO user (user, pass, website, email, avatar, location, sig) VALUES ('$username','$password', '$website', '$email', '$avatar','$location','$signature')");       mysql_query("INSERT INTO staff VALUES ('$username','Admin','0')");       mysql_query("INSERT INTO site VALUES ('$title','$description','$dat','Blue','$copyright','$url','$banner')");       echo '<center><span style="color:green;font-size:8pt;font-family: verdana">The installation was successful.</span><br><a href="../index.php"><span style="font-size:8pt;font-family: verdana">Go to the homepage</span></a></center>'; } ?>[/code]
  3. I have no idea... lol... i took the single quotes out and nothing changed.
  4. I have a form on a different page and I am getting no errors on this page (install_process.php). But the information that I entered in the form is not being entered into the database... Can some one please tell me what I have done wrong? [code]<?php   $db_username = $_POST['db_username'];   $db_password = $_POST['db_password'];   $db_host = $_POST['db_host']; $connect = 'mysql_connect($db_host,$db_username,$db_password)'; if(empty($connect)) { echo "<center><span style='color: red; font: 8pt verdana'>Database information is wrong. Please go back and retype the information.</span></center>"; } else { if ($your_password != $retype_password) { echo "<center><span style='color: red; font: 8pt verdana'>Your passwords do not match. Please go back and retype the information.</span></center>"; } else { $dat = date("D j M, Y"); $title = $_POST['site_title']; $description = $_POST['site_description']; $copyright = $_POST['site_copyright']; $url = $_POST['site_url']; $banner = $_POST['site_banner']; $username = $_POST['your_username']; $password = md5($_POST['your_password']); $location = $_POST['your_location']; $email = $_POST['your_email']; $avatar = $_POST['your_avatar']; $website = $_POST['your_website']; $signature = $_POST['your_signature'];       $installed = '$installed';       $new_content = "<? " . $installed . " = 'yes'; mysql_connect('" . $db_host . "','" . $db_username . "','" . $db_password . "'); ?>";       $file = fopen('../db_connect.php', 'a');       fwrite($file,$new_content);     fclose($file);       include("../db_connect.php");       mysql_query("INSERT INTO user (user, pass, website, email, avatar, location, sig) VALUES ('$username','$password', '$website', '$email', '$avatar','$location','$signature')");       mysql_query("INSERT INTO staff VALUES ('$username','Admin','0')");       mysql_query("INSERT INTO site VALUES ('$title','$description','$dat','Blue','$copyright','$url','$banner')");       echo '<center><span style="color:green;font-size:8pt;font-family: verdana">The installation was successful.</span><br><a href="../index.php"><span style="font-size:8pt;font-family: verdana">Go to the homepage</span></a></center>';     } } ?>[/code]
  5. OK well i got it now... thanks for the help
  6. OK thank you soo much! but now i get these errors: Warning: fopen() expects at least 2 parameters, 1 given in /fpgs/fpgshttpd/majestic-neo/blah/ssCommunity/ssCommunity/install_process.php on line 34 Warning: fwrite(): supplied argument is not a valid stream resource in /fpgs/fpgshttpd/majestic-neo/blah/ssCommunity/ssCommunity/install_process.php on line 35 Warning: fclose(): supplied argument is not a valid stream resource in /fpgs/fpgshttpd/majestic-neo/blah/ssCommunity/ssCommunity/install_process.php on line 36
  7. Do you know how i should format it then? i am trying to rewrite my previous scripts and am having a hard time...
  8. Now im getting this error: Parse error: parse error, unexpected $ in /fpgs/fpgshttpd/majestic-neo/blah/ssCommunity/ssCommunity/install_process.php on line 39
  9. OMG!! thank you lol... that was easy...
  10. [code]<?php $db_username = $_POST['db_username']; $db_password = $_POST['db_password']; $db_host = $_POST['db_host']; if($your_password != "$retype_password") { echo "<center><span style='color: red; font: 8pt verdana'>Your passwords do not match. Please go back and retype the information.</span></center>"; } else { $con = mysql_connect("$db_host","$db_username","$db_password"); if (!$con)   {   echo "<center><span style='color: red; font: 8pt verdana'>Database information is wrong. Please go back and retype the information.</span></center>";   } else { $dat = date("D j M, Y"); $title = $_POST['site_title']; $description = $_POST['site_description']; $copyright = $_POST['site_copyright']; $url = $_POST['site_url']; $banner = $_POST['site_banner']; $username = $_POST['your_username']; $password = md5($_POST['your_password']); $location = $_POST['your_location']; $email = $_POST['your_email']; $avatar = $_POST['your_avatar']; $website = $_POST['your_website']; $signature = $_POST['your_signature']; mysql_query("INSERT INTO user (user, pass, website, email, avatar, location, sig) VALUES ('$username','$password', '$website', '$email', '$avatar','$location','$signature')"); mysql_query("INSERT INTO staff VALUES ('$username','Admin','0')"); mysql_query("INSERT INTO site VALUES ('$title','$description','$dat','Blue','$copyright','$url','$banner')"); $new_content '<? mysql_connect("$db_host","$db_username","$db_password"); ?>'; $file = fopen('db_connect.php'); fwrite('$file','$new_content'); fclose($file); } ?>[/code] Here is the error i get: Parse error: parse error, unexpected T_CONSTANT_ENCAPSED_STRING in /fpgs/fpgshttpd/majestic-neo/blah/ssCommunity/ssCommunity/install_process.php on line 34
  11. Iryk

    Sessions

    That didnt work either :(
  12. Iryk

    Sessions

    OH yeah... lol... Well I fixed that... Now its not reading the COOKIE. Also is it possible to use the date() function instead of the time()? [code]<? if($setCookie == "yes") { setcookie(adventCalendar, doNotWarn, time() + 3600); header("Location: http://neopets.com/winter/adventcalendar.phtml"); } else { if(isset($_COOKIE['adventCalendar'])) { echo '<font color="green">Advent Calendar</font><br>'; } else { echo '<a href="adventCalendar.php?setCookie=yes"><font color="red">Advent Calendar</font></a><br>'; } } ?>[/code]
  13. Iryk

    Sessions

    I am trying to make a session/cookie that will last until the next day (ie. if is Mon. then it expires on Tue). But everytime the page is visited the script doesn't create a cookie. I am have checked and made sure I had cookies enabled and everything. Please Help! [code]<? if($setCookie == "yes") { setcookie('adventCalendar', doNotWarn, time()+1); header("Location: http://neopets.com/winter/adventcalendar.phtml"); } else { if(!isset($_COOKIE["adventCalendar"])) { echo '<a href="adventCalendar.php?setCookie=yes"><font color="red">Advent Calendar</font></a><br>'; } else { echo '<a href="http://neopets.com/winter/adventcalendar.phtml"><font color="green">Advent Calendar</font></a><br>'; } } echo $_COOKIE["adventCalendar"]; ?>[/code]
  14. [code]<?php //featured game //initiate curl $ch = curl_init(); //give curl the url to visit curl_setopt($ch, CURLOPT_URL,"http://www.neopets.com/weather.phtml"); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); //load the page into a variable $result=curl_exec ($ch); //close the connection curl_close ($ch); //split each line into a value in an array $lines = explode("\n", $result); //cycle through each line in the array until we find a specific pattern foreach ($lines as $line_num => $line) { //get image and url $pattern = 'Average temperature today is \<b>([^\']*)\<\/b> degrees C (\<b>([^\']*)\<\/b> degrees F)\<p>\<center>\<img src=\'([^\']*)\' width=150 height=150 border=0>/'; if (preg_match($pattern, $line, $matches)) {   $temp = $matches[1]; $image = $matches[3]; } } echo "$tempĀ° C<br><img src='$image'>"; ?>[/code] What am i doing wrong here is the url to the page: [a href=\"http://majestic-neo.com/v.3/portal/\" target=\"_blank\"]http://majestic-neo.com/v.3/portal/[/a] Error: Warning: preg_match() [function.preg-match]: Delimiter must not be alphanumeric or backslash in /fpgs/fpgshttpd/majestic-neo/v.3/portal/weather.php on line 20
  15. [code]<? $query = "SELECT * FROM `topics` WHERE `Category`='$category' ORDER BY `ID` DESC LIMIT 0,30"; $result = "mysql_query(" . $query . ")"; $get = "mysql_fetch_array(" . $result . ")"; $i = 1;     echo "<table>";     while($get) {         $id = $get['ID'];         $topic = $get['Topic'];         $author = $get['Author'];         $date = $get['Date'];         $replies = mysql_num_rows(mysql_query("SELECT * FROM `replies` WHERE `Topic`='" . $topic . "'"));             if($i % 2 == "1") {                 $bgcolor = "#E4E4E4"; } else {                 $bgcolor = "#EEEEEE"; }                 echo "<tr bgcolor='" . $bgcolor . "'>";                 echo "<td width='50%'>" . $topic . "</td>";                 echo "<td width='20%'>" . $author . "</td>";                 echo "<td width='20%'>" . $date . "</td>";                 echo "<td width='10%'>" . $replies . "</td>";                 echo "</tr>";         $i++;     }     echo "</table>"; ?>[/code] It is only giving the result of m for my values. Can some one please tell me what I am doing wrong?
×
×
  • 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.