
spacepoet
Members-
Posts
320 -
Joined
-
Last visited
Profile Information
-
Gender
Not Telling
spacepoet's Achievements

Advanced Member (4/5)
0
Reputation
-
Nevermind! For some reason it just started working .. odd .. Anyway, thanks for reading .. I would close this topic but I do not see where to do this .. ??
-
Hello: I have been trying to install Open Cart (5.4 plus earlier verions) on a GoDaddy account, and I keep getting the same error and I do not know what it means or how to fix it: Warning: session_start() [function.session-start]: open(/var/chroot/home/content/c/a/s/castleplace/tmp/sess_5ug76ut9rv7oiirj2ct3p2lt37, O_RDWR) failed: No such file or directory (2) in /home/content/c/a/s/castleplace/html/system/library/session.php on line 11Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/c/a/s/castleplace/html/index.php:100) in /home/content/c/a/s/castleplace/html/system/library/session.php on line 11Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/c/a/s/castleplace/html/index.php:100) in /home/content/c/a/s/castleplace/html/system/library/session.php on line 11 Does anyone know what the solution is? The account has PHP5.2 .. I do know that I have "magic_quotes_gpc = Off;" in the php.ini file (as it is suppose to be turned off) but there was a message during installation that it was still enabled. Would this be the cause? If so, how do I turn it off? Trying it in .htaccess cause an Internal 500 error. Thanks.
-
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
ISSUE SOLVED !!! I am glad! I used the $l_id (Locations id) to write the URL and Location as two different pieces of data. Looking back I should have done that in the first place, but this is all part of a learning process. Happy Holidays to me! And everyone else!! -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
So it creates a much nicer SEO friendly URL, and it gets listed on the page with the service: 1.Private-Music-Lessons-Private-Music-Teacher.html Becomes 1.Private-Music-Lessons-Private-Music-Teacher.Philadelphia.PA.19128.html And gets listed on the page that way. Page: <html> Private Music Lessons | Private Music Teacher </html> Becomes <html> Private Music Lessons | Private Music Teacher | Philadelphia PA 19128 </html> I did this when I programmed with Classic ASP and it worked like a charm; just need to figure out this last piece. Any ideas .. ?? -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Or .. is it possible to split the SESSION into 2 parts/names so I can use 1 for the URL and 1 to display on the pages .. ?? session_start(); if (isset ($_GET['myLocationContent'])) { $_SESSION['myLocation'] = $_GET['myLocationContent']; } if(empty ($_SESSION['myLocation'])){ $_SESSION['myLocation'] = 'Philadelphia PA 19128'; } Any ideas on this ... -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Sigh .... Maybe it would be better to try mod re-write .. ?? I have it working on the link I posted: echo "<li class='site-map-ul-li'><a href='1.Private-Music-Lessons-Private-Music-Teacher.".(str_replace(" ","-","$myLocationContent")).".html' title='".$myLocationContent."'>".$myLocationContent."</a></li>"; but I since it is 1 SESSION, it is also writing the dashes into the location on the page .. Can I somehow add this to my .htaccess for the 2 URL re-writes so it only writes it into the URLs .. ?? RewriteRule ^([0-9]+).([a-zA-Z0-9\-]+).([a-zA-Z0-9\-]+)\.html$ myPage.php?id=$1&myPageURL=$2&myLocationContent=$3 [L] RewriteRule ^1.Private-Music-Lessons-Private-Music-Teacher.([a-zA-Z0-9\-]+)\.html$ myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=$3 [L] -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Trying it this way: echo "<li class='site-map-ul-li'><a href='1.Private-Music-Lessons-Private-Music-Teacher.".str_replace(" ", "-" $myLocationContent).".html' title='".$myLocationContent."'>".$myLocationContent."</a></li>"; but I keep getting errors .. Any idea how to correct this .. ?? I'm excited - almost there! -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Hi there: Just letters, numbers and hyphens. No special characters; just trying to keep it straight-forward. Is this something I would do in the SESSION, and the have 2 variables to use .. ?? Or, can I somehow work it into the URL .. ?? header("location:1.Private-Music-Lessons-Private-Music-Teacher.".($_SESSION['myLocation']).".html"); Thanks! EDIT: Thinking about it, if I can just replace the spaces with hyphens in the URL string I posted, I would be more than happy! Possible? -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
I GOT IT !!!!! Seems that this part: ... if (!ctype_alnum ($_GET['myLocationContent'])) { $error = 'Not a valid city name'; ... was causing the error New code: session_start(); if (isset ($_GET['myLocationContent'])) { $_SESSION['myLocation'] = $_GET['myLocationContent']; } if(empty ($_SESSION['myLocation'])){ $_SESSION['myLocation'] = 'Philadelphia PA 19128'; } Is working! One last part: any idea how I can replace the spaces with dashes in the URL *ONLY* .. so I can write the URL as: Philadelphia-PA-19128 And the text on the page as: Philadelphia PA 19128 ?? Thanks for staying with me and helping me out! I really appreciate it. -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Hi again: Yes, I would say it is stopping at the first space. Good point. Exact output code - I assume you mean the sitemap.php page and .htaccess file (I know this can be streamlined/coded better, but this is my first attempt at doing something like this). I removed only the HTML/CSS markup sitemap.php: <?php session_start(); if (isset ($_GET['myLocationContent'])) { if (!ctype_alnum ($_GET['myLocationContent'])) { $error = 'Not a valid city name'; } else { $_SESSION['myLocation'] = $_GET['myLocationContent']; } } if(empty ($_SESSION['myLocation'])){ $_SESSION['myLocation'] = 'Lancaster'; } include('include/db.php'); $con = mysql_connect($db_host, $db_user, $db_password); mysql_select_db($db_table); ?> <!DOCTYPE html> <html> </head> <body> <h1 class="mm-h1">Site Map</h1> <ul class="site-map-ul"> <? $query = "SELECT id, myPageActive, myPageURL, myButtonTitle, myTitle FROM myPageData WHERE myPageActive='Yes' ORDER BY listorder"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); for($j=0;$j<$num_rows;$j++) { $row = mysql_fetch_array($result); $id = $row['id']; $myTitle = $row['myTitle']; $myButtonTitle = $row['myButtonTitle']; $myPageURL = $row['myPageURL']; echo "<li class='site-map-ul-li'><a href='$id.$myPageURL.".($_SESSION['myLocation']).".html' title='".$myTitle." ".($_SESSION['myLocation'])."'>".$myButtonTitle." ".($_SESSION['myLocation'])."</a></li>"; } ?> </ul> <h1 class="mm-h1">Locations</h1> <ul class="site-map-ul"> <? $query2 = "SELECT myLocationActive, myLocationContent, l_listorder FROM myLocations WHERE myLocationActive='Yes' ORDER BY l_listorder"; $result2 = mysql_query($query2); $num_rows2 = mysql_num_rows($result2); for($j=0;$j<$num_rows2;$j++) { $row2 = mysql_fetch_array($result2); $myLocationContent = $row2['myLocationContent']; echo "<li class='site-map-ul-li'><a href='myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=$myLocationContent' title='".$myLocationContent."'>".$myLocationContent."</a></li>"; } ?> </ul> </body> </html> .htaccess (full file): # Mod Rewrite Options FollowSymLinks Options -MultiViews RewriteEngine on RewriteBase / # This makes the default page the one with an id of 1 RewriteRule ^$ myPage.php?id=$1&myPageURL=$2&myLocationContent=$3 [L] RewriteRule ^admin/index-login\.html$ admin/index-login\.php [L] RewriteRule ^sitemap\.html$ sitemap.php [L] RewriteRule ^sitemap\.xml$ sitemap-XML.php [L] RewriteRule ^robots\.txt$ robots.php [L] RewriteRule ^([0-9]+).([a-zA-Z0-9\-]+).([a-zA-Z0-9\-]+)\.html$ myPage.php?id=$1&myPageURL=$2&myLocationContent=$3 [L] myPage.php: (HTML/CSS removed) <?php session_start(); if (isset ($_GET['myLocationContent'])) { if (!ctype_alnum ($_GET['myLocationContent'])) { $error = 'Not a valid city name'; } else { $_SESSION['myLocation'] = $_GET['myLocationContent']; } } if(empty ($_SESSION['myLocation'])){ $_SESSION['myLocation'] = 'Lancaster'; } include("include/db.php"); $con = mysql_connect($db_host, $db_user, $db_password); mysql_select_db($db_table); $id = $_GET['id']; $myPageURL = ""; $myTitle = ""; $myDesc = ""; $myHeader = ""; $mySubHeader = ""; $myPageContent = ""; $myReadMore = ""; $myPageContentMore = ""; $myBannerContent = ""; $photo = ""; $continue = false; if(isset($_GET)) { if($id!="") { $query = "SELECT id, myTitle, myDesc, myHeader, mySubHeader, myPageContent, myReadMore, myPageContentMore, myBannerContent, photo_filename FROM myPageData WHERE id = $id"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if($num_rows>0) { $row = mysql_fetch_array($result); $continue = true; $myTitle = $row['myTitle']; $myDesc = $row['myDesc']; $myHeader = $row['myHeader']; $mySubHeader = $row['mySubHeader']; $myPageContent = $row['myPageContent']; $myReadMore = $row['myReadMore']; $myPageContentMore = $row['myPageContentMore']; $myBannerContent = $row['myBannerContent']; $photo = $row['photo_filename']; } } } if(!$continue) { header("location:1.Private-Music-Lessons-Private-Music-Teacher.".($_SESSION['myLocation']).".html"); } ?> <html> <body> <?php echo htmlspecialchars ($_SESSION['myLocation']); ?> </body> </html> It definately writes the session variable properly onto myPage.php if it it just 1 word and if I go back to the sitemap.php it is still there, so I know it is storing; it's just not working with the spaces. This is the last piece of this website so any way you know to fix this would be great! Thanks much for the help. -
Why Does Query String Not Work With Spaces Or Dashes .. ?
spacepoet replied to spacepoet's topic in PHP Coding Help
Hi: Thanks, good catch and good point but it did not fix it .. Not sure what you mean by "exactly what URL are you trying?" but: (This is generated after I click the link I posted) Works: http://www.website.com/myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=Philadelphia Does not work http://www.website.com/myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=Philadelphia%20PA There is no %20 in the address bar after I click the link, but when I copied and pasted it into this post there is. It displays like this in the address bar: http://www.website.com/myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=Philadelphia PA It goes to myPage.php via mod rewrite and picks up the session and displays it if it 1 word, but not more than 1 (it keeps keeps the previous session with 1 word): <?php session_start(); if (isset ($_GET['myLocationContent'])) { if (!ctype_alnum ($_GET['myLocationContent'])) { $error = 'Not a valid city name'; } else { $_SESSION['myLocation'] = $_GET['myLocationContent']; } } if(empty ($_SESSION['myLocation'])){ $_SESSION['myLocation'] = 'Philadelphia'; } ?> <html> <?php echo htmlspecialchars ($_SESSION['myLocation']); ?> </html> Any ideas ..?? -
Hello: I have a problem that has stumped me. I have this query string and mod rewrite in .htaccess: sitemap.php echo "<li class='site-map-ul-li'><a href='myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=$myLocationContent' title='".$myLocationContent."'>".$myLocationContent."</a></li>"; .htaccess RewriteRule ^([0-9]+).([a-zA-Z0-9\-]+).([a-zA-Z0-9\-]+)\.html$ myPage.php?id=$1&myPageURL=$2myLocationContent=$3 [L] If "$myLocationContent" is one word - "Philadelphia" it works fine But, if it is two or more words with either a space or a dash ("Philadelphia PA" or "Philadelphia-PA") it does not work. Any idea why .. ?? I ideally want to write the URL as "Philadelphia-PA.html" and display it on the page as "Philadelphia PA"
-
Hello: I will have to explore getting a local server. But, I did get it to work this way: echo "<li><a href='myPage.php?id=1&myPageURL=Private-Music-Lessons-Private-Music-Teacher&myLocationContent=$myLocationContent' title='".$myLocationContent."'>".$myLocationContent."</a></li>"; which is not ideal, but at least it is a start. Can you recommened how I might use mod re-writing to make a "better" URL .. ?? I do want the id to always be 1 and the myPageURL to always be "Private-Music-Lessons-Private-Music-Teacher" I use this to re-write the other pages, but it does not work for this. RewriteRule ^([0-9]+).([a-zA-Z0-9\-]+).([a-zA-Z0-9\-]+)\.html$ myPage.php?id=$1&myPageURL=$2myLocationContent=$3 [L] One other thing I noticed (it is always something!): when I use 1 word for the "myLocationContent (like "Philadelphia") it writes the URL fine, but if it is 2 or more words (like "Philadelphia PA" - I assume the space is the issue) it does not work. Can this be fixed .. ?? Thanks for all the advice and input!
-
Hi there: I can't re-start the server .. it's a site hosted at GoDaddy .. Can you think of a way to solve my problem .. ?? Any solutions or "tricks" to get this working would be greatly appreciated .. Thanks!
-
Oh, I see what you mean. I found (via GOOGLE) that it should be: if (!ctype_alnum ($_GET['myLocationContent'])) { not alphanum But, it has not changed how the page works (meaning, I still get the same results). Do you even have error reporting turned on? I'm going to say no, because my next question is to ask how I turn that on ... ?? I'm still learning .. EDIT: I just added this (exactly as I listed it) to the php.ini file: ini_set('error_reporting', E_ALL); but no errors are displayed .. Is this the correct way to do it .. ??