Jump to content

renfley

Members
  • Posts

    89
  • Joined

  • Last visited

Everything posted by renfley

  1. lol well good new is that if i create a variable with the desc it works great! <?php $site_desc = $tags['description']; i can then echo this and insert into my insert statement which works great but for the title that is an issue. <?php $url="http://www.example.com"; function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } } $site_title = getTitle("http://www.example.com"); echo $site_title; The echo works perfect but when i add the $site_title variable to my insert statement everything seem ok but nothing get inserted into the databse? Any ideas
  2. Actually I've test the above code and and it works perfectly I am stuck at the insert to database part basically here is the code <?php mysql_select_db($db, $con); mysql_query("INSERT INTO ls_sites (site_title, site_url, site_desc) VALUES ('Peter', 'Griffin', '35')"); mysql_close($con); Now in the above statement i am able to echo the following <?php $tags = get_meta_tags("$website"); echo $tags['description']; Now i would like to change the name peter in the insert statement to reflect whatever is the store variable in $tags['description'] kinda like <?php mysql_query("INSERT INTO ls_sites (site_title, site_url, site_desc) VALUES ($tags['description'], 'Griffin', '35')");
  3. ok so thanks to something call old friends ive written the following! <?php //$url="www.viraleh.com"; function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } } //Example: $website = "http://www.hotscripts.com"; echo getTitle("$website"); $tags = get_meta_tags("$website"); echo "<br/>"; echo "<br/>"; echo "<br/>"; echo $tags['description']; echo "<br/>"; echo "<br/>"; echo "<br/>"; $host = "root"; $user = "localhost"; $pass = ""; $db = "spider"; $con = mysql_connect($host,$user,$pass); if (!$con) { die('Could not connect: ' . mysql_error()); } $con = mysql_connect("localhost","peter","abc123"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db($db, $con); mysql_query("INSERT INTO Persons (FirstName, LastName, Age) VALUES ('Peter', 'Griffin', '35')"); mysql_close($con); Except instead of firstname,ECT... I would like to post into Site (Sitename, Site_desc) Values (getTitle("$website", echo $tags['description']; This last parts i really require some help
  4. Ok after some more researche i have found that this works great for getting sitename <?php function getTitle($Url){ $str = file_get_contents($Url); if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } } //Example: echo getTitle("http://localhost/"); ?> Now i would like something to get the descripttion Any helpers?
  5. hey guys im looking for some input from the comunity since this a complicated coding issue i will ask the pros!!! [PS that called sucking up ] Ok so here is my end goal! User arrive to a certain webpage He inputs his Web URL and hits submit. Here is where i get stuck as for my solution!. I would like to runs a script once the url is submitted that will scan the URL and collect and store information in a database, basicly i would like three things. i would like to save the sitename, url, description. I really hope this isnt as complicated as it seems. Thanks
  6. ok so im trying to figure out how to put a thumbnail on the front page and once the thumbnails is clicked would then send the user to another page to watch the video. Sounds simple i know but i have been struggling for like two days on this issue. Here is the website, Or testing grounds. Ive taken an existing template and completly revamped it and i have a few things left to bugger out in the template file but this is definatly the worse. http://www.liquidscripts.com The first post you see is a thumbnail which then bring you to the singlepost.php and only diplay the image if you click the image it shows just the image i would like that once the thumbnail is clicked only to display the embeded video. here is the function php <?php if ( function_exists('register_sidebar') ) register_sidebar(array( 'before_widget' => '', 'after_widget' => '', 'before_title' => '<h1>', 'after_title' => '</h1>', )); // Enable support for post-thumbnails add_theme_support('post-thumbnails'); // If we want to ensure that we only call this function if // the user is working with WP 2.9 or higher, // let's instead make sure that the function exists first if ( function_exists('add_theme_support') ) { add_theme_support('post-thumbnails'); } ?> Here is the single post.php <?php get_header(); ?> <?php get_sidebar(); ?> <div id="main"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> <?php the_content('Read the rest of this entry »'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> <?php the_tags('<p>Tags: ', ', ', '</p>'); ?> <p class="post-footer align-right"> <span class="readmore"><?php the_category(', ') ?></span> <a href="<?php comments_link(); ?>" class="comments">Comments <?php comments_number('0','1','%'); ?></a> <span class="date"><?php the_time('M jS, Y') ?><!-- by <?php the_author() ?> --></span> </p> <?php comments_template(); ?> <?php endwhile; else : ?> <h1>Not Found</h1> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> <?php get_footer(); ?> and here is the main index template.php <?php get_header(); ?> <?php get_sidebar(); ?> <div id="main"> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h1> <?php the_content('Read the rest of this entry »'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> <?php edit_post_link('Edit this entry.', '<p>', '</p>'); ?> <?php the_tags('<p>Tags: ', ', ', '</p>'); ?> <p class="post-footer align-right"> <span class="readmore"><?php the_category(', ') ?></span> <a href="<?php comments_link(); ?>" class="comments">Comments <?php comments_number('0','1','%'); ?></a> <span class="date"><?php the_time('M jS, Y') ?><!-- by <?php the_author() ?> --></span> </p> <?php comments_template(); ?> <?php endwhile; else : ?> <h1>Not Found</h1> <p>Sorry, but you are looking for something that isn't here.</p> <?php endif; ?> </div> <?php get_footer(); ?> Guys i would really appreciated some input here.
  7. Hey guys quick question. I have one static ip address that if i put in the broswer it will forward to the internal ip of my server and will display my website which is located on my server. In my house i also have a development pc which is accessibal within my local network and i would like to be able to view it from my website in an iframe or something. My goal is to just go to my website have a page which will load the local internal ip of my dev pc and display my wamp folder. so i can show my clients the progress on their site. I know this is now good practice but this is just and simplified example of what i am trying to achieve. I would like to display te internal ipaddress on my webserver so that when im on the road i can simply click a link on my website and display the content of my dev pc wamp server? Is ther a special link that i need to use? Is this possible with or without PHP? Should i use an iframe?
  8. Hey guys im stuck in a bind and need some input. What im trying to do is display a number based from community levels. ex: This user need another 2 tasks to get next level. here are the levels 1- 0-2 task new 2- 2-5 tasks beginer 3- 5-7 tasks pro 4- 7+ tasks advanced The way it works is by two different tasks. basicly i wanna know which is the higher number in the tasks either how many posts or comment and figure out based on our levels how many tasks he need to complete in order for him to reach the next level. the first query sees how many post this user has the second check how many comment he has I wanna take the highest number and that belongs to whicheber catgory, do a calculation. and have this kind of output This user is level 2 and need 1 more task to reach the next level. Like i know if he need one more that he has 4 tasks done. I know im all over the place with this one im just trying to get someone who might have an idea of my issue and point me in the right direction. Either if this is a known ?? does this procedure has a specific name anything will help me.
  9. im trying to avoid this echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> echo <div></div> lol
  10. iwas thinking more something like $this is the qurey above foreach($result) { ?> <div> <p>this is the title of the row</p><?php echo title; ?> </div> this way it will deisplay every row and give me more control over the content?
  11. hey just curious if i could pull this off some how <?php $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("database", $con); $result = mysql_query("SELECT title FROM table1"); foreach($result) { ?> <div><?php echo title; ?> </div> <?php mysql_close($con); ?> Basicly im trying to query the database and foreach result display it within divs? ive been trying to figure it out for a while and im stuck any help would be awsome thanks
  12. Warning: mkdir() [function.mkdir]: File exists in C:\wamp\www\renfley\config\register.php on line 47 You have successfully Registered Still getting error Safe mode is off ive already ruled that one out but this one is very strange my query is fine i just think there some issue with passing a $ in the mkdir?
  13. Warning: mkdir() [function.mkdir]: File exists in C:\wamp\www\renfley\config\register.php on line 47 You have successfully Registered The members dir is already created i only need to create a folder based on my variable, $id = mysql_query("SELECT id FROM users WHERE username='$username'"); // this will get the id that you inserted to your table. mkdir("members/$id"); echo "You have successfully Registered";
  14. thats would work bu i wanna pass a $var in the mkdir to create a folder based on the id of the user? if that makes sense
  15. irst question is i guess i cant get the mkdir to create a members/001 and i cant figure it out for the life of me any help would be freaking awsome <?PHP //Database Information $dbhost = "localhost"; $dbuser = "root"; $dbpass = ""; $dbname = "xxx"; //Connect to database mysql_connect ( $dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $fname = $_POST['fname']; $lname = $_POST['lname']; $city = $_POST['city']; $username = $_POST['username']; $password = md5($_POST['password']); $email = $_POST['email']; $newsletter = $_POST['newsletter']; $pubdir = $_POST['pubdir']; // lets check to see if the username already exists $checkuser = mysql_query("SELECT username FROM users WHERE username='$username'"); $username_exist = mysql_num_rows($checkuser); if($username_exist > 0){ echo "I'm sorry but the username you specified has already been taken. Please pick another one."; unset($username); include 'register.html'; exit(); } // lf no errors present with the username // use a query to insert the data into the database. $query = "INSERT INTO users (fname, lname, city, username, password, email, newsletter, pubdir) VALUES('$fname', '$lname', '$city', '$username', '$password', '$email', '$newsletter', '$pubdir')"; mysql_query($query) or die(mysql_error()); mysql_close(); //this will create a folder for the customer. //$query1= "Select UID Where username = $username " //$id = //$id = mysql_insert_id(); // this will get the id that you inserted to your table. //mkdir("members/$id", 0755); $id = mysql_query("SELECT id FROM users WHERE username='$username'"); // this will get the id that you inserted to your table. mkdir("$id"); echo "You have successfully Registered"; // mail user their information $yoursite = "www.xxx.com"; $webmaster = "Administrator"; $youremail = "[email protected]"; $subject = "You have successfully registered at $yoursite..."; $message = "Dear $fname, you are now registered at our web site. To login, simply go to our web page and enter in the following details in the login form: Username: $username Password: $password Please print this information out and store it for future reference. Thanks, $webmaster"; mail($email, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion()); echo "Your information has been mailed to your email address."; ?>
  16. if( strtolower( $language->_lang ) == "fr-fr" ) $query = "Select id,idea_1 as title, challenge_id as challenge, is_anonymous from " . $db->nameQuote('#__table1_ideas') . " where userid = '" . $user->id . "' and is_draft = '0'"; else i want to extract from table2 the challenge_title based on the challenge_id pull from table one if that makes sense Again thanks man
  17. I havnt a clue how LOL i know it is a very Very Simple solution but i just cant figure it out for the life of me LOL
  18. So here is the deal i am querying one table withing the database and displaying them within another view. if( strtolower( $language->_lang ) == "fr-fr" ) $query = "Select id,idea_1 as title, challenge_id as challenge, is_anonymous from " . $db->nameQuote('#__table1_ideas') . " where userid = '" . $user->id . "' and is_draft = '0'"; else Prob is i also need challenge title from another table If anyone can help me out that would be great Thanks in advance
  19. Hey guys im a little stumped. My pages has the following links. <a href="?page=yes">Yes</a> to Change content i use <?php if (isset($_GET['page'])) { include ("include/".$_GET['page'].".php"); } else { echo 'Welcome to Liquids Scripts PHP Code repository. Just select the categorie from the top and get all the info required '; } ?> Will this be tracked by google analytics? Any help would be awsome.
  20. Can someone point me in the right direction im looking to convert publisher files online to pdf with php but i havnt sound any resources, and yes ive googled it !!!!!! Any help would really be apreciated guys Thanks Again
  21. Hey guys havent coded in a while and im stumped. Ive checked google but to no avail lol i wanna include my config file and have an IF statement to run/include another file IE... <?php include("config/config.php"); If File(Not Exist); include("install/config.php"); ?> If someone can put me back on track it would be greatly epreciated
×
×
  • 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.