PHP - Localhost .v. Webserver Issue
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 ^_^ Similar TutorialsI 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. 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? 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! 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? 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 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, 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, 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? This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321687.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=316783.0 hello dear PHP-experts i run opensuse 13.2 i ve set up an apache webserver - well - if i type localhost into the browser then i see: it works but i want to see also phpmyadmin: the phpmyadmin on apache server - installed but not visible - what can i do now. I think that i have to check the running services on the machine!!? Which test can be done - with the terminal ? Which tests can i run on commandline ? love to hear from you greetings does anyone know of a simple tutorial which will show me how to receive email sent via my localhost? i cant develop my script fully because of the email errors. thanks Hi, my school say not to use XAMPP, and I already have PHP installed, MySQL installed, Apache I am not sure, but assuming if I have it installed, how do I connect to localhost b/c beforer when I use XAMPP, the default for where to get php/mysql running was: C:\xampp\htdocs\ Please any help appreciated! I'm looking to connect to a MySQL localhost on my mac. I've been working for a few hours at this and I still can't figure it out. Below is my code. I've tried a number of different ways to connect to the database including using new mysqli, mysql_connect and PEAR MDB2. Any suggestions as to what I can do? Thanks in advance. <?php $first=$_POST['first']; $last=$_POST['last']; if (!$first || !$last) { echo 'Error: Enter the required data.'; exit; } if (!get_magic_quotes_gpc()) { $first = addslashes($first); $last = addslashes($last); } $hostname = 'localhost:8889'; $username = 'root'; $password = 'root'; $dbname = 'phonebook'; @ $db = new mysqli($hostname,$username.$password,$dbname); if (mysqli_connect_errno()) { echo 'Errer: Could not connect to database'; exit; } echo '.....Connected Successfuly'; $query = "insert into contact values ('null','".$first."','".$last."')"; $result = $db->query($query); if ($result) { echo $db->affected_rows." contact inserted into the database"; echo 'Contact Entered: '.$first.' '.$last.''; } else { echo 'Error: Contact not added.'; exit; } $db->close(); ?> this problem really drives me crazy..hope that anyone could help. I left my page only with <?php session_start(); ?> with no script at all..and i still got error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:\Program Files\XAMPP 1.5.4\xampp\htdocs\folder\page1.php:1) in E:\Program Files\XAMPP 1.5.4\xampp\htdocs\folder\page1.php on line 2 No white space at all. I tried to upload this file into the server (not local) and no error appeared. but when i run it in my local server, error appeared. I restart my xampp so many times but still didn't fix this. what's the problem then? thanks in advance Hi, I still a noob in PHP programming I hope somebody in the forum can help me and give an ideas how to fixed to this problem, everytime I run localhost this message appear: ErrorException in Builder.php line 1023:count(): Parameter must be an array or an object that implements CountableBut if I type localhost/(anycharacter) the page appear but with error 404(kindly refer to image, all other buttons are working except the one indicated with the arrow( kindly refer on the last image, note: app_debug set to true), this problem keeps bugging me for a few weeks now that I still cannot find a way to fixed it. Thank you in advance. )
Hello, I am trying to create a registration module where an email would be sent to the user after registration. I am using xampp and have tried php mailer http://sourceforge.net/projects/phpmailer/files/phpmailer%20for%20php4/0.90/ but couldn't get it to work... I've been told that it is possible to send an email from localhost through smtp... I need to know how to accomplish that. Am a beginner. suggestions and help would be appreciated Hi, would like to know if there is any way to send email using localhost? is it possible and how can i do it? This topic has been moved to Other. http://www.phpfreaks.com/forums/index.php?topic=327407.0 |