Jump to content

Northern Flame

Members
  • Posts

    816
  • Joined

  • Last visited

    Never

Everything posted by Northern Flame

  1. Im not sure exactly what language is used to do this, but im guessing its a mixture of javascript, css, and html so I posted it here.... anyways, I want to create a custom file box, <input type="file"> I want to be able to edit the popup box you get when you click browse, is this possible? if so..... how?
  2. simple have the user send the data by POST and then create 2 mail() functions, one for the user and one for the owner....
  3. phpMyAdmin is a "control panel" of your MySQL database's. you can create-edit-delete databases through this and create-edit-delete tables through it. and he was asking to post your PHP script that will be getting and inserting the data into your database....
  4. you can try to find a way to fix it via CSS and just place this in your head section, <!--[if IE7]> <style type="text/css"> /* YOUR CSS FIX HERE */ </style> <![endif]-->
  5. try making a new script, try this: page1.php <?php session_start(); $_SESSION['test'] = 'It Worked!'; echo '<a href="page2.php">page2</a>'; ?> page2.php <?php session_start(); if(!isset($_SESSION['test'])){ echo 'It\'s not working....'; } else{ echo $_SESSION['test']; } ?> that should work, if it doesnt, that i really have no idea whats wrong....
  6. nope, still not working, this is the error i get
  7. Anyone? ??? I think it is because you cannot have a function in the fwrite() function, but I dont know, does anyone know if i can have a function in the fwrite() function or does anyone know the solution to my problem?
  8. This is the php thread, and your topic has nothing to do with php, also, check google!
  9. I created a podcast, and i wrote a script that should update the podcast with information from a MySQL database whenever the file is activated. It doesnt do it though. Im thinking it is because my information is in a function, im not sure, but here is the script. <?php mysql_connect("localhost", "user", "pass"); mysql_select_db("db"); $radio = "./../../../radio.xml"; $open_radio = fopen($radio, 'w'); function updateMusic(){ $song_query = mysql_query("SELECT * FROM radio ORDER BY artist"); ?> <?xml version="1.0" encoding="utf-8"?> <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> <channel> <title>My Podcast</title> <itunes:subtitle>My Podcast</itunes:subtitle> <link>http://mywebsite.com/</link> <description>My Description</description> <language>en</language> <itunes:author>Me</itunes:author> <itunes:owner> <itunes:name>Me</itunes:name> </itunes:owner> <docs>http://blogs.law.harvard.edu/tech/rss</docs> <managingEditor>me@website.com (Me)</managingEditor> <webMaster>me@website.com</webMaster> <?php while($song = mysql_fetch_array($song_query)){ echo ' <item>' . "\n"; echo ' <title>'. $song['name'] . ' - ' . $song['artist'] . '</title>'. "\n"; echo ' <description>'. $song['name'] . ' by ' . $song['artist'] .'</description>'."\n"; echo ' <guid isPermaLink="true">'. $song['link'] .'</guid>'."\n"; echo ' <pubDate>'. date("D, d M Y H:i:s") . '+0000' . '</pubDate>'."\n"; echo ' <enclosure url="'. $song['link'] .'" length="4803811" type="audio/mpeg"/>'."\n"; echo ' </item>'."\n"; } echo '</channel>'."\n"; echo '</rss>'; } fwrite($radio, updateMusic()) or die("Could Not Write To File"); fclose($radio); ?> When i run this script I get the die error, could not write to file
  10. you might have to change the allowed upload file size on the server via .htaccess and make the directory that you want to upload to writable heres how to increase your max file upload size in .htaccess php_value post_max_size 1000M php_value upload_max_filesize 1000M php_value max_execution_time 6000000
  11. do you mean you want this to be displayed in the same page that your form is located? then you have to move the script to the same page that the form is located, heres and example: <?php function myForm(){ ?> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST"> name:<br> <input type="text" name="name" size="20"><br> Address:<br> <input type="text" name="address" size="20"><br> Password:<br> <input type="password" name="password" size="20"><br> <input type="submit" name="submit" value="Submit"> </form> <?php } if(!isset($_POST['submit'])){ myForm(); exit(); } else{ <?php //$checkline="checkline"; //unused $name=$_POST["name"]; $address=$_POST["address"]; $password=$_POST["password"]; if(empty($name) || empty($address) || empty($password)) { echo "Please Enter name, email and password"; myForm(); die; } //darkfreaks email checker if (!preg_match("/^(.+)@[a-zA-Z0-9-]+\.[a-zA-Z0-9.]+$/si", $address)) { echo "Error, email not valid"; myForm(); die; } $namelen=strlen($name); if ($namelen<5) { echo "Error, name entered is under 5 characters long."; myForm(); die; } $passwordlen=strlen($password); if ($passwordlen<5) { echo "Error, password entered is under 5 characters long."; myForm(); die; } $efile=fopen("*****privatefile*****.txt","a+") ; if ($efile) { $inuse = false; while ( !feof($efile) && !$inuse) { $f_name = trim(fgets($efile)); $f_address = trim(fgets($efile)); if($f_name == $name) { echo "user '$name' is already used \n"; $inuse = true; } if($f_address == $address) { echo "email '$address' is already used \n"; $inuse = true; } myForm(); } if(!$inuse) { fwrite ($efile, $name . "\n"); fwrite ($efile, $address . "\n"); fwrite ($efile, $password. "\n"); echo"Registration Succesful, Thank you $name"; echo" You will be one of the first to recieve all of our amazing offers! " ; echo"You will recieve your username and password soon, Check your inbox. " ; echo"Please click your browsers back button to return to fonecave. " ; } fclose($efile); } ?> }
  12. so should it be function pageContent(){ global $errors; ...... } or pageContent(); global $errors;
  13. I added the $errors = array(); part but im still getting the error
  14. I created a contact form, which I have created before in almost the exact way, but this time I'm getting an error, the error reads: Warning: Invalid argument supplied for foreach() in /path/to/my/website.com/contact.php on line 40 Heres the script (line 40 is the line that has "foreach()" and the function pageContent() is what is displayed on the page): <?php $name = $_POST['name']; $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; if(empty($name)) $errors[1] = "You forgot to fill out your name!"; if(empty($email)) $errors[2] = "You forgot to fill out your email address!"; if(empty($subject)) $errors[3] = "You forgot to fill out the subject!"; if(empty($message)) $errors[4] = "You forgot to fill out the message!"; if(!empty($errors)){ function pageContent(){ ?> <div id=content1> <h2>You had the following errors!</h2> <?php foreach($errors as $key => $val){ echo ' <i>-'.$val.'</i><br>'."\n"; } ?> <form action="/contact.php" method="POST"> Name:<br> <input type="text" name="name" size="20" value="<?php echo $name; ?>"><br> Email:<br> <input type="text" name="email" size="20" value="<?php echo $email; ?>"><br> Subject:<br> <input type="subject" name="subject" size="20" value="<?php echo $subject; ?>"><br> Message:<br> <textarea name="message" rows="7" cols="30"><?php echo $message; ?></textarea><br> <input type="submit" name="submit" value="Send"> </form> </div> <?php } include 'template/index.php'; exit(); } ?>
  15. Im not 100% sure, but I dont think you can use PHP in a file with the extention ".js" therefor it wont work in a Javascript file.
  16. I want to create an .htaccess file that blocks ALL ip's except for a selected few. Is there a way to do this? And also, I only want this to affect ONE file, is there a way to tell the .htaccess file only to block all the IP's except a certain few from a certain file? Thanks for any suggestions
  17. alright ill check it, thanks for the tip
  18. I have a swf file and i made the html so that it will play on my website but it doesnt.... the html code is correct, but when i tried to access the swf file through my browser nothing was displayed, why is it not playing? it works fine on my desktop when i created an html file on my computer to play it.... heres the link to the html and swf file, can anyone help? http://wap.northernflame.com/martinez/index.html http://wap.northernflame.com/martinez/flash.swf
  19. hello, this is a simple question about using include, whenever I try to include a file located in a directory before the current directory, it wont let me unless i use the entire path, such as http://domain.com/file.php an example of what im talking about: I am at http://domain.com/directory/file.php and i want to include http://domain.com/include.php other than writing include('http://domain.com/include.php'); is there an easier way to include a file in the previous directory?
×
×
  • 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.