Jump to content

Search the Community

Showing results for tags 'help'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hello! l was wondering if you might be able to help me. l am trying to find out how to make PHP read a file, and then check if that text is already there, and if so don't re-write it. l'll give out my code for an example. <?php //text file that counts the peeps that visit the site $lne = "line.txt"; $File = "counter.txt"; $handle = fopen($File, 'r+') ; //file open $data = fread($handle, 512) ; //file read $count = $data + 1; //Adds one person :DDDDD fseek($handle, 0) ; fwrite($handle, $count) ; //saves the new person echo 'Count #'.$count; // // // // // // $File2 = "ips.txt"; fclose($handle) ; if (isset($_POST['ip'])) { $ip = $_POST['ip']; $port = $_POST['port']; echo 'Connecting to ' . $ip . ':' . $port; exit(); } $ip = getenv("REMOTE_ADDR"); echo '<br>'.$ip; $handle2 = fopen($File2, 'r+') ; //file open $data2 = fread($handle2, 512) ; //file read fwrite($handle2,"\n" . $ip .':' . $count); //saves the new ip ?> <html> <form method="POST"> <input type="hidden" name="ip"> <input type="hidden" name="port"> </html> lt just re-writes the lP with the new counter, very annoying. l can filter it out with VB but l want it all to be server sided. Thank you for your time ~Papa Beans
  2. Hai guys, I'm busy with a category display script, but do I replace the text for an URL? Example: I've this code at the moment: <?php $query="SELECT `cat` FROM `video` WHERE `id`='".$_GET['video']."'"; $sql=mysql_query($query) or die(mysql_error()); while($line=mysql_fetch_array($sql)) { echo ''.$line['cat'].''; } ?> The output for example is: Category1,Category2,Category3. So, what do I need to let the output be like this: <a href="category.php?cat=Category1">Category1</a>, <a href="category.php?cat=Category2">Category2</a>, <a href="category.php?cat=Category3">Category3</a> Thanks for any help!
  3. its a login form here is my code thats producing the error . I am really new to php. this is for a project . thanks for the help. function login($username , $password){ GLOBAL $dbc; //database $user_id= user_id_from_username($username); $username = sanatize($username); $password = md5($password); $query= mysqli_query($dbc,"SELECT COUNT(`user_id`) FROM `users` WHERE `username` = '$username' AND `password ` = '$password'"); MYSQLI_ERROR($query); $check= mysqli_fetch_array( $query , MYSQLI_BOTH); // even if i add this set of code the query still gives the above error. }
  4. <?php if ($_FILES["file"]["error"] > 0) { echo "Error: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Thank You For Your Submission, Please Come To Our Next Discssuion To Recieve Your Answer" . $_FILES["file"]["name"] . "<br>"; } $temp = explode(".", $_FILES["file"]["name"]); $extension = end($temp); { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload" . $_FILES["file"]["name"]; } } <?php i keep getting an error on my closing php "PHP: Parse error: parse error on line 39"
  5. Hey guys! I'm new to the forum, but I'm making this post because of my sincere frustration with PHP right now. I love web development and I do have a passion for it. Right now I'm working on a personal portfolio, and I would like for it to be all created from scratch using HTML, CSS, Javascript, and PHP. I want to have a basic Home Page, About, Portfolio, and Contact page. I want to have an admin section to log in with. I want the public to not be able to do anything but view whats on the pages I want the admin to be able to edit whats on a page with some sort of WYSIWYG box The reason I want to take my own approach instead of using wordpress, or drupal; is because I'm really looking forward to furthering my education and feel it would be a good experience. I've made basic login systems, and CRUD systems in School. But never have I done one with my own project. I have all of the HTML done, and the layout of the site (design aspect) complete. But whats next?what should my database look like? My Question: Where do I start? If this were you, how would you do this? I'm really looking for someone to help draw this out for me and tell me how you'd approach this. Your help is sincerely appreciated.
  6. <!DOCTYPE html> <html> <head> <script> function HideComment() { document.GetElementById("comments").hide("textarea") } </script> </head> <body> <textarea name="" cols="" rows="" id="comments" onClick="">leave comment</textarea> </body> </html> i am trying to get the text area to hide when i click a button. this is what i have but doesnt seem to work. can someone help me?
  7. I was hoping to have a little help getting this to work. I installed VanillaForum on my website, and wanted to hook my login system into it so they shared a common username, and password (and if possible not have to log in twice) I am using JPMaster's login script found at http://www.evolt.org/node/60384 I was able to get his scripts to read Vanilla's DB and reconize the username and password, but it errors out during the proccessing Hopfully you all can help me out so i can get this working (Yes i know the DB info in the script isnt correct i removed my info when posting this) Login.zip any help will be very helpful Thanks in advanced
  8. Hi, First of all i want to apologize if i posted this in the wrong section. I am not really sure where it will go. So Mods, if u feel this thread belongs elsewhere, please shift it there. Now my problem: I am making this interface for shoppers where they can input their shopping list and the program will return a map with the shortest route to get the stuff they want. I dont know how to generate a map using PHP. I have a basic layout of the map, but how do i mark the locations on the map and then output it to the user as a single image? Regards, Makrand
  9. Hi, I need help with my ecommerce site. Some of the things I need help with are as follows: paypal and credit card payment gateway easy automatic refunds through clickable button product upload (can add price, % off, $ off, and sale expiry date that removes % or $ off of price when it expires and also displays a price after the sale factor is calculated. Can also select product type and sub product type from corresponding custom iframe) product mangement (edit and delete) Account creation including adding locations of stores, adding flyers and adding special offers (have to have specific image size requirements for upload) Shopping cart with a shopping cart login page and billing info form. Wish list Product comparison Simple search with location and distance search modifier users location finder (gets the location of the user viewing the site and displays it in the location field) I need to know the estimated amount of time required to add each of these. The price I pay per hour will reflect on how many hours it takes to put this site together and get it working properly. Send me a message if you can help me with this site. Thanks, Luke!
  10. Hi. I'm a php newbie and I just want to ask something. I have this simple Shopping Website, and I'm already done with the shopping cart which I learned from the phpacademy.org. Whenever the customer entered the final phase in ordering, I want all her orders to go to a table in my phpmyadmin database called 'transactions' so I can put up all the transactions made in one table. The problem is I cannot think of a way on how can I enter each item she ordered in the table. For example, she ordered 1 dress and 1 pants. Then these will be treated as 1 transaction right? But I want to save these to the table as 2. One row for pants and another for the dress. Can somebody help me? I'm really having a hard time. Thanks in advance!
  11. Hey guys, I have been trying to install Zend on Xampp for days, i've looked at pretty much every website that has instructions and it is just not working for me. I would enormously appreciate if someone could help me do it while I share screen over a skype call. Please let me know, thanks a lot Paul
  12. Hi There, I am trying to make a login system with PHP and I have made one but I can't see the problem, it just keeps taking me back to login.php. All files involved attached. Many Thanks for Your Help in Advance. includes.zip
  13. Hi There, I have got this code: function displayPosts() { $query = mysql_query("SELECT * FROM social ORDER BY id DESC") or die(mysql_error()); while( $result = mysql_fetch_assoc($query) ) { echo ' <div id="socialnewsfeeditem"> <p id="newsfeeditemperson"> '.$result["fullname"].' </p> <p id="newsfeeditemcontent"> '.$result["content"].' </p> <p> <center> <a href="social.php?id='.$result["id"].'&do=like">Like!</a> </center> </p> <div id="likes"> <p>'.self::displayLikes($result["id"]).'</p> </div> </div> '; } } function displayLikes($id) { $query = mysql_query("SELECT full_name FROM sociallike WHERE postid = '$id'") or die(mysql_error()); while( $result = mysql_fetch_assoc($query) ) { echo $result['full_name']."likes"; } } function like($id, $username) { $query2 = "INSERT INTO sociallike VALUES('$id', '$username')"; mysql_query($query2); } But when I try to displayLikes the all come up all over the place on the page and I have no clue why it is doing this. I will upload the whole (functions.php) functions and the (social.php) php file on here. Many Thanks for Your Help functions.php social.php
  14. Hi There, I have got this code: function displayPosts() { $query = mysql_query("SELECT * FROM social ORDER BY id DESC") or die(mysql_error()); while( $result = mysql_fetch_assoc($query) ) { echo ' <div id="socialnewsfeeditem"> <p id="newsfeeditemperson"> '.$result["fullname"].' </p> <p id="newsfeeditemcontent"> '.$result["content"].' </p> <p> <center> <a href="social.php?id='.$result["id"].'&do=like">Like!</a> </center> </p> <div id="likes"> <p>'.self::displayLikes($result["id"]).'</p> </div> </div> '; } } function displayLikes($id) { $query = mysql_query("SELECT * FROM sociallike WHERE postid = '$id'") or die(mysql_error()); } function like($id, $username) { $query2 = "INSERT INTO sociallike VALUES('$id', '$username')"; mysql_query($query2); } But when I try to displayLikes the all come up all over the place on the page and I have no clue why it is doing this. I will upload the whole (functions.php) functions and the (social.php) php file on here. Many Thanks for Your Help social.php functions.php
  15. I am creating a website in Adobe Dreamweaver CS6. I am trying to add a page with a membership form that inputs fields to a database. I have set up a local test server(using xampp) that has worked. Ie the form accepts the data and passes it through to the database. However, when I put the form and files to the Remote Server and try to access the membership entry form page (www.friendsofchopin.org.au/mem_form.php) I get the following error: Warning: mysql_pconnect() [function.mysql-pconnect]: Access denied for user 'chopinau_admin'@'localhost' (using password: YES) in /home/chopinau/public_html/Connections/memconn.php on line 9 Fatal error: Access denied for user 'chopinau_admin'@'localhost' (using password: YES) in /home/chopinau/public_html/Connections/memconn.php on line 9 code is: <?php # FileName="Connection_php_mysql.htm" # Type="MYSQL" # HTTP="true" $hostname_memconn = "localhost"; $database_memconn = "chopinau_membership"; $username_memconn = "chopinau_admin"; $password_memconn = "xxxxxxxxxxx"; $memconn = mysql_pconnect($hostname_memconn, $username_memconn, $password_memconn) or trigger_error(mysql_error(),E_USER_ERROR); ?> Any help would be greatly appreciated
  16. Hi all, I've a problem with my PHP code. I've a page, where you can select multiple pages, which will be displayed at the related section on my site. So far, you can select the pages, and they will be injected into the database, and they will be displayed on the site. My only problem is: the pages won't be selected on the edit page. I've this piece of code, and I don't know what I'm doing wrong. <?php $id = $_POST["id"]; $sql=mysql_query("SELECT `title`,`url`,`volg`, `headerpicture`, `picture`, `product_id` FROM `pagina` WHERE `id`='".$id."' LIMIT 0,1"); $row=mysql_fetch_assoc($sql); echo '<select MULTIPLE name="related[]">'; if ($row['related'] != '') $related_array=explode(',',$row['related']); else $related_array=array(); $query="SELECT `id` FROM `producten`"; $sql=mysql_query($query) or die(mysql_error()); while($line=mysql_fetch_array($sql)) { $query1="SELECT `title` FROM `pagina` WHERE `product`=1 AND `product_id`='".$line['id']."'"; $sql1=mysql_query($query1); if(mysql_num_rows($sql1) >0) { $line1=mysql_fetch_array($sql1); $selected=' '; foreach($related_array as $related_line) { if ($related_line == $line['id']) $selected=' selected '; } echo '<option'.$selected.'value="'.$line['id'].'">'.$line1['title'].'</option>'; } } echo '</select>'; ?> What am I doing wrong? Is there a piece of code I need to script?
  17. Hi guys, I'm kinda new to PHP, and I started with developing a site. Now I've a piece of code (check below), it is suppost to edit a page in the database, but the output is "Error updating database1: Unknown column 'title' in 'field list'". But, the column exist! All variables are set, and I don't know what I'm doing wrong, and I hope you guys can help me. Code: $query_update = "UPDATE `pagina` SET `title` = '".addslashes($title)."', `korting`='".$korting."', `volg`='".$volg."', `product` = '".$product."',`product_id`='".$product_id."', `visible` = '".$visible."', `metadescription` = '".addslashes($metadescription)."', `url` = '".$url."', `content` = '".addslashes($content)."', `headerpicture`='".addslashes($headerpicture)."',`picture`='".addslashes($picture)."', form_id = '".$form_id."',`related`='".$related_string."', `datum` = NOW() WHERE `id` = '".$id."'"; mysql_query($query_update)or die('Error updating database1: '.mysql_error()); Column: Greetzz iRoot121.
  18. Hello all, I just have to start by saying i am very much new to PHP. Iv only done basic things but would really like to learn more. I am also new to forums so please try see past my "not so bright" moments and help. I have to build a interactive calendar. People who visit the website will select days they would like to rent the flat for. This will then make those dates unavailable for other people, so they shouldnt be able to select it. The cost of the flat will change according to date (Jan-dec : December being more expensive for christmas etc.) Rates will also influence the cost. Is there some sort of tutorial or site i could visit that will show me how to do this? Or does any one maybe know how to help me? I am quite despirate for help and information. Being the noob isnt exactly awesome. Please, please, please help me - Anything will help
  19. I'm currently in the middle of developing a privacy options features which will allow members of my site to toggle whether their information is visible to friends only or to the public. I'm doing this with PHP. When the privacy_opt variable is set to "fri" though, which means friends should only be able to see the content, the content isn't hidden to the public. I'm using the following PHP code. <?php $sqlo = "SELECT * FROM user_optionsc0nf WHERE id='$id' LIMIT 1"; $opt_query = mysqli_query($db_conx, $sqlo); // ------- WHILE LOOP FOR GETTING THE MEMBER DATA --------- while($row = mysqli_fetch_array($opt_query, MYSQLI_ASSOC)){ $privacy_opt = $row["privacy_opt"]; } if ($privacy_opt == "fri" && $id != "$logOptions_id" && $friendArray == "$logOptions_id"){ echo "Only this person's friend can see this information."; } else { echo $website, $youtube, $locationInfo; } ?> The $friendArray variable contains the users friends ID's in the form of 51, 100, 22, etc. $logOptions_id holds the ID of the current logged in user.
  20. I'm a beginner and i need more help, i wanna know where i can see corect example, exemple how work... I ask this think because i know many sorce buy i see whith many mistake... I search on forums, book, and youtube video... For programming what kind of server I must use for linux?
  21. Hello All, Well I am new to this forum and just came to get the answer of one question. :cool: I am working on building one PHP based site and have to add one feature to it. But I am not sure how I can achieve this. May be any of you can help me. Thanks in advance, here's the thing I wanna achieve:- My site has total 2 pages. On one page there is one form where user will enter one "ID" for ex. "ID1234", as soon as he entered this, the whole site [of 2 pages] must be duplicated with this new ID used in domain. Ex. If my site name is "www . mywebsite . com", then a duplicated site must have this kind of link "www . mywebsite . com/ID1234" or "www . mywebsite . com/?R=ID1234". I have to urgently make this thing work out. All the responses will be appretiated. Thank you
  22. $handle = fopen($fullPath, "rb"); $bin=NULL; while(!feof($handle)){ $bin = $bin.fread($handle,sizeof($fullPath));} fclose($handle); //var_dump($bin); $db_lite = initDbLite(); $stmt = mssql_init('dbo.InsertFlagDownloadImage', $handleMS); mssql_bind($stmt, '@PatientNum', $paramArray['PatientID'], SQLINT2, false, false); mssql_bind($stmt, '@DloadLogNum', $DloadLogNum, SQLINT2, false, false); mssql_bind($stmt, '@FileTypeNum', $filetype, SQLINT2, false, false); mssql_bind($stmt, '@FlagDloadBinaryImage', $bin, SQLVARCHAR, false, false); mssql_bind($stmt, '@PassFail', $MsCheckArr['PassFail'], SQLVARCHAR, true, false, 25); mssql_bind($stmt, '@ErrorMsg', $MsCheckArr['ErrorMsg'], SQLVARCHAR, true, false, 101); mssql_execute($stmt); echo mssql_get_last_message(); First time poster so excuse an nuances of the forum I do not know yet. I have been facing this problem at work for the last couple days and even with relentless forum searching I have been unable to answer it. At my company we have an old C/C++ program that processes downloads from a sqlite db to a MSSQL db. My job, as the intern this summer, is to take that outdated (15 y.o.) program and convert it to a php script that does EXACTLY what it does. I had limited knowledge of php or database work up until this point but I was eager to learn. My program executes a series of stored procedures within a MSSQL db to store data. I learned quickly how to make this work and that the best way to do this was using bind because it prevents from being easily hacked (intercepted, is the other term I read over on the web). . My problem : In three of the stored procedures I need to store a BLOB in a MSSQL db stored procedure that accepts an image type. When attempting to use mssql_bind I get an error when inserting my data, regardless of the mssql datatype I use. My attempts at solving this : 1. Re-write the way I acquire my BLOB in an attempt to rule that out as the issue. -- failed 2. Scour the web for a MSSQL datatype that is compatible with the stored procedures image field. -- failed, I was unable to find anything that was IMAGE specific. 3. Increase the data transfer size in the freetds.conf file -- failed 4. Found in a forum on the web instructions to try SQLVARCHAR and SQLTEXT as the MSSQL datatypes -- failed, using SQLVARCHAR results in an error on the bind call and SQLTEXT results in an error on the execute call. Currently, I am at a wall with this project and don't really know where to go from here. Are there other ways of executing stored procedures without the use of bind? How much of the security side of things will not using bind compromise? Also, for what it's worth I found a bug report on the php website from about 5 years ago that describes my problem. The link is : http://grokbase.com/t/php/php-bugs/0644ny6bxe/36961-new-mssql-bind-will-not-bind-an-image-field Thanks for any and all help you all can give, MF
  23. Hi php Freaks XD I have a small problem. I have a form that i would like to make it so i can add a column to my table on my site. but the form that fills our the stuff, when i press the submit button i don't get a response. Here is a rly simple code that i can't get to work. When i press the button it should say "success", and if the textbox is empty it should say "error". simple right? Well i can't get any response what so ever. here is the code in simpel. if(isset($_POST['addTableBtn'])){ if(empty($_POST['addTableText'])){ echo "Error"; }else{ echo "Success"; } } and the submit button name and textbox name match, i have checket.
  24. OKay so I am trying to make this simply update my mysql server. Can anyone maybe see why this isn't working? The code all works perfectly up until while statement... So if someone maybe sees something wrong? Thanks... <? session_start(); include('nconnect.php'); $uname=$_POST['to']; $result = mysqli_query($con, "SELECT * FROM messages WHERE to='{$uname}' "); $content=$_POST['content']; while($row = mysqli_fetch_array($result)){ mysqli_query($con, "UPDATE messages SET content='{$content}' WHERE to='{$uname}' "); header('location: p1.php'); } ?>
  25. I will paste the code below. Okay so I've benn trying to work with SQL in php connecting to a MySQL Database I have hosted on my own computer. I am trying to use an HTML form to get in info I need. But when I hit SUBMIT I don't get the output I was looking for. Any ideas why my code wont work? Also, I am sorry if this is the wrong section, I am new to the forum, if this is the wrong section, can someone please point me to where i need to go? Thanks! <html> <form action="index.php" method="post"> <input type="text" name="username"><br> <input type="text" name="password"><br> <input type="submit"> </form> </html> <?php $uname = $_POST[username]; $pword = $_POST[password]; $con=mysqli_connect('localhost', 'root2', '', 'first_db'); //Check conbnection if(mysqli_connect_errno()) { echo 'Failed to connect: ' . mysqli_connect_error(); } else{ $result = mysqli_query($con,"SELECT * FROM members WHERE username=$uname"); while($row = mysqli_fetch_array($result)) { echo $row['username']; echo $row['password']; echo $row['id']; } }
×
×
  • 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.