PHP - Moved: How To Make Webserver With Public Access?
This topic has been moved to Miscellaneous.
http://www.phpfreaks.com/forums/index.php?topic=316783.0 Similar TutorialsI have searched around and found this code that suggests that I should be able to read an image file and echo it directly in to the page without hyperlinking to the file that is outside the public folder, but i get the error message that it is not there even though the file is. Warning: getimagesize() [function.getimagesize]: Unable to access "/home/****/upload/AAABBBCCC.JPG" in /home/****/public_html/client.php on line 40 Code: [Select] $image = "AAABBBCCC.JPG"; $path= "/home/****/upload/"; $details = getimagesize($path . $image); header ('Content-Type: ' . $details['mime']); echo file_get_contents($path . $image); <? for ($i = 1; $i <= $first_day_of_month-1; $i++) { $days_so_far = $days_so_far + 1; $count_boxes = $count_boxes + 1; echo "<td width=\"125\" height=\"100\" class=\"beforedayboxes\"></td>\n"; } for ($i = 1; $i <= $days_in_month; $i++) { $days_so_far = $days_so_far + 1; $count_boxes = $count_boxes + 1; IF($_GET['month'] == $todays_month+1){ IF($todays_date == $day){ $class = "publicholidayhighlightedboxes"; } ELSE { $class = "dayboxes"; } } ELSE { IF($i == $todays_date){ $class = "highlighteddayboxes"; } ELSE { $class = "dayboxes"; } } The problem is I can only display one highlighted box in one month. For example, in November, there are two public holidays, but only 1 public holiday box is highlighted. Would appreciate if someone can help me out asap. Thank you Hi, I want to create a simple online buying site. I have an admin site with login where admin can add items to the database table, and change other fields such as price and description of product and I want to make a public html page to display the updates made in my admin page. I appreciate it if someone give me some suggestions on how to get started. My admin php scripts is working fine (so SQL queries for UPDATE, DELETE, INSERT) but I don't know how to 'sync' it with the an nice html table of products the user can checkbox off to purchase on the public website. Let me know, thanks. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321687.0 I have a site, and there is an image with a link to another page, how can I make it so this is the only way to get to that page is by clicking on that image, and not by typing www.mywebsite.com/page.php into the address bar in a browser? This topic has been moved to Apache HTTP Server. http://www.phpfreaks.com/forums/index.php?topic=357293.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=350982.0 How can I call a public function inside of another public function? The get_primary_edge() says it's undefined, but it's just another public function in the class so shouldn't this work? Code: [Select] public function get_dynamic_edge($uid) { $uid = (int)$uid; $sql = "( SELECT `users`.`id` FROM partners INNER JOIN `users` ON `partners`.`user_id` = `users`.`id` WHERE partners.friend_id = '${uid}' AND `approved` = 1 ) UNION ALL ( SELECT `users`.`id` FROM `partners` INNER JOIN `users` ON `partners`.`friend_id` = `users`.`id` WHERE `partners`.`user_id` = '${uid}' AND `approved` = 1 )"; $result = mysql_query($sql) or die(mysql_error()); $i = 0; while (($row = mysql_fetch_assoc($result)) !== false) { $dynamic[$i] = array( 'uid' => $row['id'], 'score' => get_primary_edge($row['id']), ); $i++; } print_array($dynamic); } This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=333523.0 HI. Total newby here. I have a PDF form that is crested using Adobe Acrobat. When a user fills in the form on the PDF, I want it to be sent to my web server for me to view. Ultimately, I would also like an email to let me know somethings been sent too but that's for a later day, one thing at a time. I know that on the PDF Form in Acrobat I have to specify a URL to handle the form data but what is this php file and what should it contain. I'm at a total loss with this and cannot find anything on the web about it. Can any of you geniuses help me please? I seem to be seeing a problem I havent noticed before when I use header for a redirect the session data passes to the new page when I use href it seems as though even when I do a session_start() on the new page the session data doesnt pass Is this normal or is there a setup issue on my server (bluehost) everything works fine on wamp but when i upload to implement it no good I am using this to generate PDF reports using fpdf, I want it to open a new page instead of just redirecting Is it that it is unable to pass the data to a new page on a server?? Hi! I have been on the paypal website a lot but I can't find what I am looking for. I trying to find some API so I can show Paypal links on every page I generate from mysql. When the user press Paypal button, he/or she will be redirected to paypal.com with a form where a field with the ID, already is filled in. So let's say I press Paypal button ,then a ID, to that page will be sent to paypal and when the user pay the money, a reply from paypal with the ID will come back and confirm the payment. How can I get this to work? I really hope you can help me with this! Thanks! This snippet was running perfectly on localhost, but after I uploaded the file containing this snippet on a webserver, the script does generate an error, or even displaying none (no results). #selects all data from table and displays it in textfields. If failed, it will display the error $sql = "SELECT * from tblquotes ORDER BY Rand() LIMIT 1"; $result = mysql_query($sql,$connection); if($result = mysql_query($sql ,$connection)) { $num = mysql_numrows($result); $count =0; while ($count < $num){ $q1 = mysql_result($result,$count,"quote"); $q2 = mysql_result($result,$count,"author"); $count++; } } else{ echo "ERROR: ".mysql_error(); } what seems to be the problem? Need help... I'm running on PHP 4.4.4 on Localhost and PHP 5.2.9 on the webserver. Mysql 4/5 on Localhost and Mysql 4.1.22 on the webserver I have a Login Script with a Remember me Function. The Script works flawlessly on my local server but when I upload it doesn't work on my web server. From what I can tell its a Session issue, When I log in, I make a session with the user ID, in which is used to pull all there information on other pages. On my local host it makes the sessions and everything is dandy, but on the web server it doesn't seem to make the session. Can anyone shed any light on this, I'm clueless once again ^_^ First thing: I formatted my drive today and fresh installs of Apache2, PHP5 and MariaDB on Linux Mint 17.1. No files have been messed with. Not one.
I created info.php and placed it in var/www dir. The file consists of one line: <?php phpinfo(); ?>
When I run it our of my web editor (Bluefish), instead of showing me on my web browser the PHP info page that's suppose to show, I get: <?php phpinfo(); ?>
I've been fighting this for two days! Done everything suggested by many others online...and that's why I had to scrub my drive; forgot all the files I augmented.
Does anyone know why my PHP files behave this way? I'd love to start working with PHP, but I can't until whatever's broken is fixed. Any ideas? Any suggestions? I'm at my wit's end with this.
Landslyde
Any body please help, Where session value save on webserver in which order? Hi, i have problem with libraries, with fpdf and PHPEcel, problem is same... Can't open file C:\xampp\htdocs\skripta\.... - this is path to php script on my computer everything work ok on localhost when i test, but when i upload to web server, pdf script try to create file with old windows path: Can't open file C:\xampp\htdocs\skripta\, and not with linux path... does anyone have solution, and why is that? Hi all, I am having trouble in getting my search facility to work on a web server. Currently when I run the website on my local server using WAMP it works fine and retrieves all the results contained in the database but it does not retrieve any results when uploaded to a web server. I'm currently using Heart Internet if this helps. Below is the code I have used for the search facility: Code: [Select] <?php // this script searches for matches on the posted search string in courses, modules tables. $searchstr = $_POST['search']; $trimmedstr = trim($searchstr); //trim whitespace from the stored variable echo "<h2 id='homecol'>Searching for... "".$trimmedstr.""</h2><hr class='homecols' />"; //Build SQL search queries //search courses table $queryProd = "SELECT * FROM courses WHERE courseTitle LIKE \"%$trimmedstr%\" OR courseDescription LIKE \"%$trimmedstr%\" OR courseCode LIKE \"%$trimmedstr%\"ORDER BY courseTitle"; $numresultsProd=mysql_query($queryProd); $numrowsProd=mysql_num_rows($numresultsProd); // echo "results found for courses: ".$numrowsProd."<br>"; // test code //search modules table $queryCat = "SELECT * FROM modules WHERE moduleTitle LIKE \"%$trimmedstr%\" OR moduleSummary LIKE \"%$trimmedstr%\" OR moduleCode LIKE \"%$trimmedstr%\"ORDER BY moduleTitle"; $numresultsCat=mysql_query($queryCat); $numrowsCat=mysql_num_rows($numresultsCat); // echo "results found for modules: ".$numrowsCat."<br>"; //test code // If no results found, offer google search as alternative or back to home page if ($numrowsProd + $numrowsCat == 0) { echo "<h3>Results:</h3><br>"; echo "<p>Sorry, we could not find any results for: "".$trimmedstr.""</p>"; echo "<p><a href=\"http://www.google.com/search?q=".$trimmedstr."\" target=\"_blank\" title=\"Look up".$trimmedstr." on Google\"> Click here to search on google instead</a> or Return to our <a href='../home.php'>Home Page</a></p>"; } else //list search results { if($numrowsProd >0) // list results fromcourses { $resultProd = mysql_query($queryProd) or die("Couldn't execute query"); // begin ordered list echo "<h3><strong>Results from Courses:</strong></h3><p><ol>"; $countProd = 1; // display the results returned while ($rowProd= mysql_fetch_array($resultProd)) { $courseCode = $rowProd["courseCode"]; $title = $rowProd["courseTitle"]; $prodID = $rowProd["courseID"]; $descProd = $rowProd["courseDescription"]; echo "<p><li><a href='../department/courseselect.php?pid=$prodID'>$title</a> - $descProd</li></p>"; $countProd++ ; } echo "</ol></p>"; } if($numrowsCat >0) // and/or list results from modules { $resultCat = mysql_query($queryCat) or die("Couldn't execute query"); // begin ordered list echo " <h3>Results from Modules:</h3><p><ol>"; $countCat = 1; // display the results returned while ($rowCat= mysql_fetch_array($resultCat)) { $moduleCode = $rowCat["moduleCode"]; $catName = $rowCat["moduleTitle"]; $catID = $rowCat["moduleID"]; $descCat = $rowCat["moduleSummary"]; echo "<p><li><a href='../department/module_detail.php?pid=$catID'>$catName</a> - $descCat</li></p>"; $countCat++ ; } echo "</ol></p>"; } echo "<p>Please click on either the course or module to view further information</p>"; } ?> If anyone has any ideas please let me know. Thanks Hi guys, I have a website that I created and it has the ability to upload images to a directory that is located in the same web server, but there are so many images now and it is taking too much space. What I am trying to do now is for the script to upload the images to a different server but don't want to run FTP on that second server if I don't need to. Does anyone know how I can do that? Thank you guys in advanced, This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=307669.0 |