PHP - Simple Help Needed
Hello EXPERTS ,
i want to Frame many pages of same code so how to do it from one page example 1 = www.abcd.com/Frame1.html [has the code given below in it] <iframe src="http://abcdsecond.com/Frame1.html" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> www.abcd.com/Frame2.html [has the code given below in it] <iframe src="http://abcdsecond.com/Frame2.html" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> and so on , so is it possible to create one php script in www.abcd.com so when abcd.com/Frame1.html or Frame2.html or Frame3.html is run it will run this code <iframe src="http://abcdsecond.com/Frame1.html" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> <iframe src="http://abcdsecond.com/Frame2.html" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> <iframe src="http://abcdsecond.com/Frame3.html" border="0" framespacing="0" marginheight="0" marginwidth="0" vspace="0" hspace="0" frameborder="0" height="100%" scrolling="yes" width="100%"></iframe> would appreciate help Similar TutorialsI recently converted my business to an ip-pbx that has lots of capabilites. Among them is a feature I would like to use called http_notify. It sends a post to a url with parameters such as caller id number, caller id name etc.. I need to write a simple program to accept these parameters and write them to a csv file along with a date/time stamp. This seems like a super easy, short piece of code to come up with and as a noob I was hoping to write this myself. I have found a few examples where the post is for a form but I can't find any examples where the data is coming in as part of the url. This is the description of the feature on the phone system site: HTTP Notify Sends notifications to a remote web server through a URL. This allows allows an event in a Jive Core PBX to trigger an action on a remote system. Simply enter a URL in the node, and that URL will be hit with an HTTP POST as calls 'pass through'. Multiple variables are available and all variables are also included in the post body. URL Defines the URL to be used (limit of 255 characters). Next Node Connects nodes together to create a call flow. Drag and drop on the next node in the dial plan. Hello there, I'm quite new on PHP language.I'm trying to make an simple Phone book apps.I added insert & show options in Phone book.Now i want to add "update & delete" option.How can i do that. This is add code: Code: [Select] <?php mysql_connect("localhost","admin",""); mysql_select_db("simphp"); //Get Values from form $name=$_POST['name']; $email=$_POST['email']; $number=$_POST['number']; mysql_query("insert into phonebook(name,email,number) values('$name','$email','$number')"); echo"Saved Sucessfully"; echo "<br/>"; echo '<a href="index.php/">Homepage</a>'; echo "<br/>"; echo '<a href="select.php/">Show Data</a>'; echo "<br/>"; echo '<a href=update.php>Update</a>'; mysql_close(); ?>Show.php=>> Code: [Select] <?php mysql_connect("localhost","admin",""); mysql_select_db("simphp"); $query="select *from phonebook"; $result=mysql_query($query); $num=mysql_numrows($result); echo"Number of records Stored:$num"; $i=0; while($i<$num) { $name=mysql_result($result,$i,"Name"); $email=mysql_result($result,$i,"Email"); $number=mysql_result($result,$i,"number"); echo "<br/>"; echo "Name :<b> $name </b><br/>"; echo "<br/>"; echo "Email : <b>$email</b> <br/>"; echo "<br/>"; echo "Phone :<b>$number</b><br/>"; echo '<a href=update.php>Update</a>'; $i++; } ?> How can i update and delete data?? :confused:help me Hi I have a simple idea for a webapp I would like to pay someone to develop for my small business. It's a system for tracking "one off" orders we get. Basically at the moment we use paper notes. Problems with this:- - They get lost - In 6 months time if the customer wants to reorder, you have to take the customer's details again, which isn't very professional - If I remember I've taken an order for something I can't do anything about it (i.e. let my colleagues know) until I'm next at work. etc etc I wanted built a web app (basically a webpage front end to a as yet non-existent database) which would allow us to log these items and then have a search/query function where we would look through:- "open orders" "closed orders" "orders awaiting collection" etc offers to mefijob@forward.cat thanks! I have two mysql tables, one is called "posts", the other is called "removed_posts", I have joined them together and can get some of the information from the tables, but I want to be able to get all of the information. This is my query, and the variables I need the information to go to: Code: [Select] $quer = mysql_query("SELECT posts.id, removed_posts.post_id FROM posts, removed_posts WHERE posts.id=removed_posts.post_id AND removed_posts.user_id='".$session."'"); while($get_post = mysql_fetch_array($quer)) { $session = $_COOKIE['id']; $to_id = $get_post['to_id']; $from_id = $get_post['from_id']; $post = linkify(nl2br(htmlentities($get_post['post']))); $date = time_stamp($get_post['date']); $id = $get_post['id']; What that's doing is selecting the id from 'posts' table, and selecting the post_id from the 'removed_posts' table (The query checks to make sure posts.id is equal to removed_posts.post_id), it does that just fine, since I defined what information I wanted it to get in the query, however, now I need to get the other information which will come from the 'posts' table. $get_post['to_id'], $get_post['from_id'], $get_post['post'], and $get_post['date'] I hope that's not toooooo confusing, any help would be appreciated <?php session_start(); if(!isset($_SESSION['User'] )) header('Location : error.php'); ?> im not being redirected even when the $_SESSION['User'] is not set neither does it display any error message other than a white blank space. Please help me som1 as how I can make this to work or suggest any other altenatives so as to get it redirected as i dont want anonymous users to access some contents unles he logs in as members. Thanx First and foremost I am PHP newbie so excuse the dumb question but I have been struggling with this one for hours and can not find the solution. Can someone show me how I would rewite the following wordpress code for meta tags so that it automatically strips out the character ' from the "single" page titles? Example I want this title: "My Cat's Black" to be "My Cats Black" This is the line I am trying to edit..... Code: [Select] elseif ( is_single() ) { wp_title(''); print ' | '; bloginfo('name'); } here is the full piece of code... Code: [Select] <title><?php if ( is_home() ) { bloginfo('name'); print ' | '; bloginfo('description'); } elseif ( is_search() ) { bloginfo('name'); print ' | '; _e('Search Results', 'woothemes'); } elseif ( is_author() ) { bloginfo('name'); print ' | '; _e('Author Archives', 'woothemes'); } elseif ( is_single() ) { wp_title(''); print ' | '; bloginfo('name'); } elseif ( is_page() ) { bloginfo('name'); print ' | '; bloginfo('description'); } elseif ( is_category() ) { single_cat_title(); print ' | '; bloginfo('name'); } elseif ( is_month() ) { _e('Archive', 'woothemes'); print ' | '; the_time('F'); bloginfo('name'); } elseif (function_exists('is_tag')) { if ( is_tag() ) { bloginfo('name'); print ' | '; _e('Tag Archive', 'woothemes'); print ' | '; single_tag_title("", true); } } ?></title> Any help would be greatly appreciated!! Hello Freaks! I am having problem with following code: <?php simplexml_load_string ('?xml version="1.0" encoding="utf-8"?>'); php?> This code is giving me following error Parse error: syntax error, unexpected '<' in public_html/wp-content/plugins/pluginnamehere/whatever.php on line 665 I know there is only a minor bracket problem that causing me this error. I would be helpful to you if you can modify it for me Thanks I'm attempting to implement a simple social networking system but at the moment am confused about how to create a multiple query which will display a certain user's friends list. The database contains four tables, the two tables that I'm using at the moment at 'usersTable' and 'friendshipsTable' are detailed below. usersTable | Table that stores all the user data UserID | Default primary key Forename | Surname | Username | Password | Email Address | friendshipTable | Table that stores information about friendships between users FriendshipID | Default primary key userID_1 | UserID userID_2 | UserID Status | Either Pending or Confirmed. The user's id is parsed into the url, and then saved into a variable. blah.com/userprofile.php?id=6 $id = $_GET['id']; I am familiar with creating simple queries, but can't quite work out how to set up multiple table queries. What the query needs to do is to check the userID that is parsed with the url, and then check the friendshipsTable by checking if either the userID_1 or userID_2 field matches the userID to grab the records from the table where there is a match. The next step is to check to see if the friendship is 'Confirmed' or 'Pending' and if it is 'Pending' to ignore it. Once the records have then been chosen I need the query to then check the value in either userID_1 or userID_2 that doesn't match userID and then pull the user's username and name from the usersTable so it can be displayed on a webpage. I've no idea hoe much I may or may not be overcomplicating this, an example of the code that I've got so far for this query can be found below, but that's as far as I've got at the moment. $displayFriends = mysql_query("SELECT * FROM friendshipTable, usersTable WHERE friendshipTable.userID_1='$id' OR friendshipTable.userID_2='$id' "); Cheers for any help. Hi everyone, I'm trying to select either a class or an id using PHP Simple HTML DOM Parser with absolutely no luck. My example is very simple and seems to comply to the examples given in the manual(http://simplehtmldom.sourceforge.net/manual.htm) but it just wont work, it's driving me up the wall. Here is my example: http://schulnetz.nibis.de/db/schulen/schule.php?schulnr=94468&lschb= I think the HTML is invalid: i cannot parse it. Well i need more examples - probly i have overseen something! If anybody has a working example of Simple-html-dom-parser...i would be happy. The examples on the developersite are not very helpful. your dilbertone Hello, im very green to php and I am having trouble creating a simple log in script. Not sure why this is not working, maybe a mysql_query mistake? I am not receiving any errors but nothing gets updated in the members table and my error message to the user displays. any help is appreciated! here is my php: <?php session_start(); $errorMsg = ''; $email = ''; $pass = ''; if (isset($_POST['email'])) { $email = ($_POST['email']); $pass = ($_POST['password']); $email = stripslashes($email); $pass = stripslashes($pass); $email = strip_tags($email); $pass = strip_tags($pass); if ((!$email) || (!$pass)) { $errorMsg = '<font color="#FF0000">Please fill in both fields</font>'; }else { include 'scripts/connect_db.php'; $email = mysql_real_escape_string ($email); $pass = md5($pass); $sql = mysql_query("SELECT * FROM members WHERE email='$email' AND password='$pass'"); $log_check = mysql_num_rows($sql); if ($log_check > 0) { while($row = mysql_fetch_array($sql)) { $id = $row["id"]; $_SESSION['id']; $email = $row["email"]; $_SESSION['email']; $username = $row["username"]; $_session['username']; mysql_query("UPDATE members SET last_logged=now() WHERE id='$id' LIMIT 1"); }//Close while loop echo "You are logged in"; exit(); } else { $errorMsg = '<font color="#FF0000">Incorrect login data, please try again</font>'; } } } ?> and the form: <?php echo $errorMsg; ?> <form action="log_in.php" method="post"> Email:<br /> <input name="email" type="text" /><br /><br /> Password:<br /> <input name="password" type="password" /><br /><br /> <input name="myBtn" type="submit" value="Log In" /> </form> Hi can someone pls help, im tryin a tutorial but keep getting errors, this is the first one i get after registering. You Are Registered And Can Now Login Warning: Cannot modify header information - headers already sent by (output started at /home/aretheyh/public_html/nealeweb.com/regcheck.php:43) in /home/aretheyh/public_html/nealeweb.com/regcheck.php on line 46 i need help with mysql.php this keeps coming up when i try to log into my game Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in /home/tassie12/domains/kronicalwars.co.cc/public_html/mysql.php on line 2 Warning: mysql_select_db() expects parameter 2 to be resource, boolean given in /home/tassie12/domains/kronicalwars.co.cc/public_html/mysql.php on line 3 Warning: mysql_query() expects parameter 2 to be resource, boolean given in /home/tassie12/domains/kronicalwars.co.cc/public_html/authenticate.php on line 30 Access denied for user 'root'@'localhost' (using password: YES) can someone send me the code for mysql.php for mccodes and tell me where to put the database user and pass? Hello Form, This is my first post here so hello to all . Ok now for my question. i am making an CMS system for a school project. we have decided to work with smarty. Now this question is about 2 tables. table 1: attributes it contains the collums 'att_Id, att_Lable and att_Name' table 2: pg_Data(page data) this contains the collums 'dat_Id, att_Id, dat_Lable and dat_Name' This table contains the values for the attributes from table 1. in short: |table 1 |------------------------------------------------| | att_Id | att_Lable | att_Name | |------------------------------------------------| | 1 | head | Head | |table 2 |------------------------------------------------------------| | dat_Id | att_Id | dat_Value | |------------------------------------------------------------| | 1 | 1 | This is a text | now i need a query that need a query that get out de att_label from table 1 en the value from table 2. Code: [Select] SELECT dat.dat_Value, att.att_Lable FROM pg_Attributes AS att LEFT JOIN pg_Data AS dat ON att.att_Id = dat.att_Id then i get an output in php array( [dat_Value] => this is a text [att_Lable] => head ) now this is all good but i want to get the lable of the attribute in de key of the value. So it would look like this. array( [head] => this is a text ) is there anyone how understands this and can help me let me know. Hello everyone,
I run a small url shorting service.
I have bought the script and everything which short long urls. And i want to use a php code in one of the pages.
Let me explain you in detail first.
My site is https://786.pw and user goes there and enter the long url and the short url becomes something like https://786.pw/shorturl ( for example)
Now when this short url which is https://786.pw/shorturl is hit the user is redirected to the original long url. And thats how it is supposed to work.
But in between i have the option to show a splash page which can be a advertisement or a timer or anything "
The code of splash.php is :-
<?php defined("APP") or die() // Media Page ?> <?php include_once("analyticstracking.php") ?> <section> <div class="container splash"> <?php echo $this->ads(728,FALSE) ?> <div class="row"> <div class="col-md-4 thumb"> <div class="panel panel-dark panel-body"> <img src="<?php echo $url->short ?>/i"> </div> </div> <div class="col-md-8"> <div class="panel panel-default panel-body"> <h2> <?php if (!empty($url->meta_title)): ?> <?php echo $url->meta_title ?> <?php else: ?> <?php echo e("You are about to be redirected to another page.") ?> <?php endif ?> </h2> <p class="description"> <?php if (!empty($url->meta_description)): ?> <?php echo $url->meta_description ?> <?php endif ?> </p> <br> <div class="row"> <div class="col-sm-6"> <a href="<?php echo $this->config["url"] ?>/?r=<?php echo base64_encode($url->url) ?>" class="btn btn-primary btn-block redirect" rel="nofollow"><?php echo e("Redirect me"); ?></a> </div> <div class="col-sm-6"> <a href="<?php echo $this->config["url"] ?>" class="btn btn-default btn-block" rel="nofollow"><?php echo e("Take me to your homepage") ?></a></a> </div> </div> <hr> <p class="disclaimer"> <?php echo e("You are about to be redirected to another page. We are not responsible for the content of that page or the consequences it may have on you.") ?> </p> </div> </div> </div> </div> </section>Now, I want to add solve media php script in it. Which means any user who is using our url shortner service needs to complete the captcha before he can be finally directed to the destination url. The script supports solvemedia captcha solving. I spoke to the creator of this script and he told me this. "You will need to have some basic php knowledge to achieve this. Helo dear people, I need some halp with mine script. This is part of it that works: function msan_getxmlinfo() { //global $local; //msan_download(); $path = dirname(__FILE__).'/xml/pricelist.xml'; $doc = new DOMDocument(); $doc->load($path); $msan = $doc->getElementsByTagName( "Table" ); $result = array(); foreach( $msan as $table ) { $codes = $table->getElementsByTagName( "ProductCode" ); $code = $codes->item(0)->nodeValue; $prices = $table->getElementsByTagName( "ProductPartnerPrice" ); $price = $prices->item(0)->nodeValue; $price = sprintf('%6f',$price); $availables = $table->getElementsByTagName( "ProductAvailability" ); $available = $availables->item(0)->nodeValue; $result[$code] = array('code'=>$code,'price'=>$price,'available'=>$available); } //echo "<pre>"; //print_r($result); //@unlink($path); return $result; } But now i need to insert one more element called "ProductDiscount" And aditional condition for proper price setting related so that when "ProductDiscount" is 0 (zero) then increase price by 3% and if theres any other value than 0 (zero) leave price as is. I was trying somthing like this but i cant get price increase: function msan_getxmlinfo() { $path = dirname(__FILE__).'/xml/pricelist.xml'; $doc = new DOMDocument(); $doc->load($path); $msan = $doc->getElementsByTagName( "Table" ); $result = array(); foreach( $msan as $table ) { $codes = $table->getElementsByTagName( "ProductCode" ); $code = $codes->item(0)->nodeValue; $prices = $table->getElementsByTagName( "ProductPartnerPrice" ); $price = $prices->item(0)->nodeValue; $discounts = $table->getElementsByTagName( "ProductDiscount"); if($discounts->item(0)=="0") { $price = $price*1.03; } else { $price = $prices->item(0)->nodeValue; } $price = sprintf('%6f',$price); $availables = $table->getElementsByTagName( "ProductAvailability" ); $available = $availables->item(0)->nodeValue; $result[$code] = array('code'=>$code,'price'=>$price,'available'=>$available,'discount'=>$discount); } return $result; } Help needed! i have a piece of code which subtracts credits every time a button is clicked. the original code works fine. I have since added a bonus_credit column, where i want it to function like this. if buy_credit = 0 and bonus_credit>0 then subtract from the bonus credit, but still do everything else its supposed to do.. here is the original code i had $selRes=mysql_query("SELECT buy_credit from user where id='".$hb_id."' and buy_credit>0"); if(mysql_affected_rows()>0) { $b_comm=0; $bc_updqry=mysql_query("UPDATE user set buy_credit=buy_credit-1 where id='".$hb_id."'"); $updqry=mysql_query("UPDATE cars set b_fee_paid_status='1' where id='".$aid."'"); } here is my modified code, but it doesn't seem to subtract from buy_credit if buy_credit is >0.. it should only kick in the bonus_credit usage if buy_credit is 0 $selRes=mysql_query("SELECT buy_credit,bonus_credit from user where id='".$hb_id."' and buy_credit>0 OR bonus_credit>0"); if(mysql_affected_rows()>0) { $b_comm=0; if($selRes['buy_credit']!=0) { $bc_updqry=mysql_query("UPDATE user set buy_credit=buy_credit-1 where id='".$hb_id."'"); } else { $bc_updqry=mysql_query("UPDATE user set bonus_credit=bonus_credit-1 where id='".$hb_id."'"); } $updqry=mysql_query("UPDATE cars set b_fee_paid_status='1' where id='".$aid."'"); } your help is appreciated. Hello, I'm working on a project that will let users access a website to view results. I getting via a FTP server CSV files. Files look like that (in French): "ARTICLES; BOISSONS 5.50% ; 1; ORANGINA ; 2.50; 2; PERRIER ; 5.00; 2; SCHWEPPES ; 5.00; ----------------------------------------; 5; BOISSONS 5.50% ; 12.50; RATIO %; 6.94; BOISSONS 19.60% ; 4; PELFORTH ; 10.00; 1; CHIVAS ; 7.00; 1; LIQUEUR ; 5.50; ----------------------------------------; 6; BOISSONS 19.60% ; 22.50; RATIO %; 12.50; RESTAURANT ; 1; BOUILLON POT AU FEU ; 7.00; 2; JAMBON D'AUVERGNE ; 20.00; 2; TERRINE PIED DE PORC; 16.00; 1; CASSOULET ; 20.00; 2; CONFIT DE CANARD ; 46.00; 1; CUISSE DE LAPIN ; 18.00; 1; MOURTAYROL ; 18.00; ----------------------------------------; 10; RESTAURANT ; 145.00; RATIO %; 80.56; ----------------------------------------; TOTAL ; ARTICLES ; 180.00; ------------------------------------------; ------------------------------------------; ------------------------------------------; REGLEMENTS; 2; ESPECES ; 109.50; 1; CARTE ; 70.50; ------------------------------------------; TOTAL ; REGLEMENTS; 180.00;" Basically, I'm trying to write code to "sort" each categorie (ARTICLES, REGLEMENTS....) Here is what I'd like to get: A B C D E ARTICLES; BOISSONS 5.50% ; 1; ORANGINA ; 2; PERRIER ; 2; SCHWEPPES ; BOISSONS 19.60% ; 4; PELFORTH ; 1; CHIVAS ; 1; LIQUEUR ; RESTAURANT ; 1; BOUILLON POT AU FEU ; 2; JAMBON DE DINDE ; 2; TERRINE PIED DE PORC; 1; CASSOULET ; 2; CONFIT DE CANARD ; 1; CUISSE DE LAPIN ; 1; MOURTAYROL ; TOTAL ; 5; BOISSONS 5.50% ; 12.50; 6; BOISSONS 19.60% ; 22.50; 10; RESTAURANT ; 145.00; REGLEMENTS; 2; ESPECES ; 109.50; 1; CARTE ; 70.50; A, B, D only names C, E only numbers These datas will be used to generate pie charts Thanks for your attention Hello,
I'm looking to bring another php developer on board to help with php projects. You should be skilled in laravel, php, and mysql. The job starts at $15/hr for each project. Please pm me if you are intereasted.
Hello all,
Am trying to get the answers of a survey from my DB and display the percentage.. Everything am trying seems not to be working. please what am i doing wrong.
<? $question_query = "SELECT * FROM ".$tblprefix."question WHERE category = 'Service Availability' and section = 'Information Technology Services'"; $rs = $db->Execute($question_query); $all_the_time = array(); $most_of_the_time = array(); $sometimes = array(); $never = array(); while (!$rs->EOF) { $question_id = $rs->fields['question_id']; $question_query1 = "SELECT * FROM ".$tblprefix."user_answer, ".$tblprefix."question WHERE ".$tblprefix."user_answer.question_id = ".$tblprefix."question.question_id"; $rs1 = $db->Execute($question_query1); $answer_id = $rs1->fields['user_answer_id']; $question_query2 = "SELECT * FROM ".$tblprefix."answer WHERE answer_id = '$answer_id'"; $rs2 = $db->Execute($question_query2); $answer = $rs2->fields['answer']; if($answer == 'All the time') { array_push($all_the_time,'1'); } else if ($answer == 'Most of the time') { array_push($most_of_the_time,'1'); } else if ($answer == 'Sometimes') { array_push($sometimes,'1'); } else if($answer == 'Never') { array_push($never,'1'); } $rs->MoveNext(); } $count_all_of_time = count($all_the_time); $count_most_of_time= count($most_of_the_time); $count_sometimes = count($sometimes); $count_never = count($never); ?> <table border="0" class="question_answer_table"> <tr> <td><strong>Service Availability</strong></td> </tr> </table> <table border="0" class="question_answer_table"> <tr> <td style="width:120px;">All of Time</td> <td style="width:70px;"><?=round($count_all_of_time/$totaluser*100,2) .'%'?></td> </tr> <tr> <td>Most of Time</td> <td><?=round($count_most_of_time/$totaluser*100,2) .'%'?></td> </tr> <tr> <td>Sometimes</td> <td><?=round($count_sometimes/$totaluser*100,2) .'%'?></td> </tr> <tr> <td>Never</td> <td><?=round($count_never/$totaluser*100,2) .'%'?></td> </tr> </table>Only one of the field is displaying an output. the rest are not. thanks in advance |