|
-
mod_rewrite
Date: 10/19/05
(Apache) Keywords: php, database, web, google, apache
Ok, i am a little new to apache, so go easy on me.
I have an database based website that uses id's to call each page e.g http://www.somesite.co.uk/index.php?id=1
now this i all very nice, but i find that url a little long for me, so i would like to be able to make it into something like http://www.somesite.co.uk/1
now i know this would have implications like if i wanted to sent to a folder past the root, like http://www.somesite.co.uk/images/1.jpg so it would have to have exceptions setup to.
now i have been told that this can be done with a mod_rewrite, but i have spend days pouring over documentation, google hits etc and i have yet to manage to do this. is there anyone out there who has a any clue's?
Thanks for any help
Source: http://www.livejournal.com/community/apache/26263.html
-
PHP/SQL static URLs giving dynamic content
Date: 10/19/05
(MySQL Communtiy) Keywords: php, database, web
howdy...
i have a fun one for you. i've written a user-driven database web-programthat uses PHP to create pages on the fly according to variables that draw information from the database. as it stands now, none of the "profile" pages actually exists, they are created via GET method - http://thepage.com/page.php?email=bob@thepage.com
now, what i'd like to do is offer my users the ability to use a static URL for example http://thepage.com/bob instead of http://thepage.com/page.php?email=bob@thepage.com. the first method i tried goes as follows.
i altered the htaccess to redirect all 404 requests to a file containing a script that pulled the last part of the URL "/bob" and used it as a variable to send as GET, thus creating the page. the reason i did this, theoretically it would handle ALL variations of http://thepage.com/bob that anyone could dream up and rely on the database to fill in the blanks. however, i was unable to make this work. i was able to complete the redirect portion by using a fixed redirect URL but i was unable to pull a GET variable from the URL and have it sent to the newly constructed page.
any and all suggestions are very welcome, especially if i am simply wrongheaded in my approach and there is a better, more efficient way to accomplish the same goal. thank you all for yout time and advice. take care.
Source: http://www.livejournal.com/community/mysql/71027.html
-
Server-side scripts
Date: 10/24/05
(Web Development) Keywords: php, browser, html, java, web
I want to make server-side scripts, but I have never done anything like this. So, I know very little about this subject.
I need advice on how to get started. More specifically, I need someone to show me how to make a simple website. And then, I think I can do the rest... I believe I can learn PHP by myself. I already know HTML, JavaScript, C, and some other languages. All I need is someone to show me how to start.
This is what I need:
I would like someone to show me step-by-step how to create a simple website which would have three things on it:
1. some text
2. an input textbox
3. a submit button
This website should do the following: When people visit the website and enter some text and click on submit, the browser should send the text to the server. The server then should save the information in a simple text file, and next time when someone clicks on the refresh button, this text should appear on the website at the top of the page. That's all.
I would like someone to assist me, to tell me how to create a website like this from scratch from start to finish.
I don't want to install PHP on my computer. I want to open an account at a remote server and learn how to make this simple website.
I need advice. Where should I open the account? What kind of language should I use? Should I learn Perl or PHP? Can I write the program in C? So, I have a lot of questions. Please help!
Source: http://www.livejournal.com/community/webdev/259800.html
-
Users online from several tables
Date: 10/24/05
(PHP Community) Keywords: php
Hello,
I've written users online display scripts before, but in all of those cases I have worked with one table, and all the information was garnered from one page.
I now want to be able to take information from several tables, and add them together to display the total # of users online for the entire portion of the site.
A little more background : There are several chatrooms (php based) which each display their unique # of users in a list.
So say, for example, there are these rooms, and in parenthesis is displayed the total amount of people in each room:
Lobby (24) Women (1) Men (5) Hobbiests (7)
This is all displayed on a seperate page, say roomchoice.php. Now, before you get to roomchoice.php, there is another page, signup.php. And on signup I want to display the total number of all users in the chat, possibly by adding together the # of users on line for each room. (ie : $totalusers = $lobbyusers + $womenusers + $menusers + $hobbiestusers; (using whatever the preexisting variable for displaying the # of users online from roomchoice.php)).
Now, I didn't write the chat program, or the existing user online portions of the site, and haven't yet recieved the code I will be working with, but assuming it is done similiary to the ways I have worked with users online before -- would each chatroom have it's own table to collect the online user's information (time, ip, etc) . . . and if so, would it be easier for me to somehow pull the variable information that is displayed on roomchoice.php, and just add it like i have above and display it on the signup.php page? Ad to that would I just simply use include to pull that variable information from roomchoice.php?
I know it's hard for me to ask this, because I don't know how it is set up yet, - but what are the other possible ways that I can retrieve this information without having to rewrite the entire SELECT queries for each room on signup.php.
Thank you for any help, I hope I have provided enough information, and stated my problem/question clearly.
Source: http://www.livejournal.com/community/php/357239.html
-
New to PHP's file functions
Date: 10/25/05
(PHP Community) Keywords: php, html, web, apache
Hi all,
I'm trying to muddle through a site redesign of my website, and I've hit a stumbling block when it comes to the php file functions.
When I try to run the following script:
$string = ''; $filename = 'test2.php';
// file_put_contents ($filename, $string); --- Doesn't work on my version of php.
fopen ($filename, 'w'); fwrite ($filename, $string); fclose ($filename);
The following happens: the file test.php is created with no data and permissions set at 644. The directory has permissions of 777 for testing purposes. I also get the following errors displayed onscreen:
Warning: fwrite(): supplied argument is not a valid stream resource in /home/name/public_html/dev/test.php on line 21 Warning: fclose(): supplied argument is not a valid stream resource in /home/name/public_html/dev/test.php on line 22
What I want to happen is this: test2.php is created, with the string as the contents.
I'll build in some validators after I get this part working.
I'm using PHP Version 4.3.9, on Apache. It's a remote site, so I'm not sure that upgrading my version of php is a viable option.
Any ideas? Is there something I'm missing?
Source: http://www.livejournal.com/community/php/357455.html
-
beginning web page
Date: 10/26/05
(WebDesign) Keywords: php, java, web
i need to make a beginning web page.
i want it to have a picture and a countdown... so either 1) the user scrolls over it, clicks on it, and is led to the next page OR 2) if the user doesn't click on it, the countdown will lead him/her to the next page anyway.
My questions - is there a name for this kind of page? (splash page?) - any thoughts to go about doing this? flash? javascript? php?
thanks so much!
Source: http://www.livejournal.com/community/webdesign/1003053.html
-
Email an Attachment through Flash Form?
Date: 10/26/05
(PHP Community) Keywords: php, html, java, web
Hi all...so, I have this Flash presentation to construct for a friend...
1. he wants the user to submit info registration to a flash form 2. the resulting page says "thank you, certificate of authentication has been sent" 3. he wants the jpg of the certificate emailed to the registrant as an attachment.
Do you know the action script/code to do this? it's only a mock up presentation; we would like to fake it as much as possible.
Could it be done with this:
Code:
on (release) { loadVariables("email.php",'POST'); javascript('alert("Thank you for contacting us.");'); }
---------------
PHP Code for email.php
$name = $_POST['Name']; $email = $_POST['Email']; $message = $_POST['Message'];
$name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message);
$rec_email = "info@yoursite.com"; $subject = "Online form submission";
$msg_body .= "Name: $name\n\n"; $msg_body .= "E-Mail: $email\n\n"; $msg_body .= "Comments: $message\n\n"; mail($rec_email, $subject, $msg_body);
-------------
And then could a $msg_body be HTML code that embeds the image?
Or could I possibly skip the PHP and use javascript? If so, could you possibly supply the code?
What is possibly the best way to do this? Any help is greatly appreciated thanks so much...
cross-posted to webdesign
Source: http://www.livejournal.com/community/php/358274.html
-
Email an Attachment through Flash Form?
Date: 10/26/05
(WebDesign) Keywords: php, html, java
Hi all...so, I have this Flash presentation to construct for a friend...
1. he wants the user to submit info registration to a flash form 2. the resulting page says "thank you, certificate of authentication has been sent" 3. he wants the jpg of the certificate emailed to the registrant as an attachment.
Do you know the action script/code to do this? it's only a mock up presentation; we would like to fake it as much as possible.
Could it be done with this:
Code:
on (release) { loadVariables("email.php",'POST'); javascript('alert("Thank you for contacting us.");'); }
---------------
PHP Code for email.php
$name = $_POST['Name']; $email = $_POST['Email']; $message = $_POST['Message'];
$name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message);
$rec_email = "info@yoursite.com"; $subject = "Online form submission";
$msg_body .= "Name: $name\n\n"; $msg_body .= "E-Mail: $email\n\n"; $msg_body .= "Comments: $message\n\n"; mail($rec_email, $subject, $msg_body);
-------------
And then could a $msg_body be HTML code that embeds the image?
Or could I possibly skip the PHP and use javascript? If so, could you possibly supply the code?
What is possibly the best way to do this? Any help is greatly appreciated thanks so much...
cross-posted to php
Source: http://www.livejournal.com/community/webdesign/1004396.html
-
Email an Attachment through Flash Form?
Date: 10/26/05
(Web Development) Keywords: php, html, java, web
Hi all...so, I have this Flash presentation to construct for a friend...
1. he wants the user to submit info registration to a flash form 2. the resulting page says "thank you, certificate of authentication has been sent" 3. he wants the jpg of the certificate emailed to the registrant as an attachment.
Do you know the action script/code to do this? it's only a mock up presentation; we would like to fake it as much as possible.
Could it be done with this:
Code:
on (release) { loadVariables("email.php",'POST'); javascript('alert("Thank you for contacting us.");'); }
---------------
PHP Code for email.php
$name = $_POST['Name']; $email = $_POST['Email']; $message = $_POST['Message'];
$name = stripslashes($name); $email = stripslashes($email); $message = stripslashes($message);
$rec_email = "info@yoursite.com"; $subject = "Online form submission";
$msg_body .= "Name: $name\n\n"; $msg_body .= "E-Mail: $email\n\n"; $msg_body .= "Comments: $message\n\n"; mail($rec_email, $subject, $msg_body);
-------------
And then could a $msg_body be HTML code that embeds the image?
Or could I possibly skip the PHP and use javascript? If so, could you possibly supply the code?
What is possibly the best way to do this? Any help is greatly appreciated thanks so much...
cross-posted to php & webdesign
Source: http://www.livejournal.com/community/webdev/261242.html
-
Mail form
Date: 10/26/05
(PHP Development) Keywords: php
Hello!! I have made a PHP mail form on my site.. but it's doesn't seems to work..Do you know why? Do you have any advices? :) thank you!! I'm very new to PHP and I'm a little bit confused..
EDIT:
:)
I have found the PHP script here : http://www.ibdhost.com/contact/
and my form action should be here
Let me know if you need more informations.. thanks again!!
Source: http://www.livejournal.com/community/php_dev/61489.html
-
showing "include" files
Date: 10/27/05
(PHP Community) Keywords: php, browser
In ColdFusion, when in "debug mode" I get a list of all the files that were included by the parent template. For example, if i'm viewing http://127.0.0.1/foo.cfm and foo.cfm includes bar.cfm and cheese.cfm, the bottom of foo.cfm, when rendered to the browser, looks like this:
Included Files: /bar.cfm /cheese.cfm
Is there an option in PHP to do the same thing? Something I can turn on in PHP.INI perhaps? I'm dealing with a legcay app that I inherited and am having the worst luck trying to figure out which include files are getting used, and where.
thanks.
Source: http://www.livejournal.com/community/php/358703.html
-
Hey guys, first post
Date: 10/27/05
(PHP Community) Keywords: php, browser, html, web, apache
I just wrote a script, in XHTML, from the book, saved it as predefined.php, and could not get it to show.
The other day, I installed Apache 2.0 and PHP 5 on my computer.
I set my Apache up at c:\Apache2 as recommended. I also set C:\php5 as recommended. I set up a folder at c:\webdocs, to save my files in.
I adjusted the httpd file in apache2/apache2/conf , and set Document root to c:/webdocs and Directory to c:/webdocs.
When I do a simple phpinfo.com script, it runs correctly.
However, I cannot seem to get my other scripts to work. I type them up, I save them in Notepad as All Files, .php extension. I type it directly into my webbrowser (as with phpinfo), ala http://localhost/predefined.php , but its still not working.
And Apache is constantly running. Its automatic.
Am I missing something here?
(running on XP)
Source: http://www.livejournal.com/community/php/359139.html
-
mysql_connect() not connecting, everything's right though.
Date: 10/27/05
(PHP Community) Keywords: php, mysql, database, sql, web
Well guys, I'm truly stumped, and I don't know if you guys can even help me. I've exhausted everything so far, though, so I'm going to try it anyway.
Basically I have this:
which should work just fine as all my other statements are written exactly like that (to interface with my web database) and they work just fine.
I get this error, instead:
Warning: mysql_connect(): Lost connection to MySQL server during query in /data/htdocs/world/RegularSites/iop/events_forum_search.php on line 258 Could not connect
The only thing I can think of that would matter would be that it's a SQL database I'm trying to connect to, and not a MySQL, but there is not sql_connect function or anything like that, only ms sql and m sql... can someone give me some advice on this matter? I'm desperate and under a deadline!
Thanks in adddddddvance!
Source: http://www.livejournal.com/community/php/359304.html
-
Java Script book Beginner/Intermediate, any suggestions?
Date: 10/29/05
(Javascript Community) Keywords: php, programming, java
Hey guys, I decided to buy a JS book and have budget, unlimited $$$, just need to select something decent, not stuff like "LEARN JAVA SCRIPT in 5 DAYS!!!". Can anyone suggest any good java script book?
My knowledge in JS is only copy and paste and super super super minor adjustments of already-written JS. I wanna be able to write my own. I have a big experience with php so I am not really new to programming, but I have way more experience on server-side than client-side.
Thanks.
Source: http://www.livejournal.com/community/javascript/81482.html
-
obfuscation and encoding
Date: 10/29/05
(PHP Community) Keywords: php, security, web
i have a case where i'm trying to provide some unsubscribe functionality via a link to a website in an email. i need to encode some information in the url, specifically a user id and a list so i know who they are and which list they are unsubscribing to. Security is of course important, I don't want anyone to be able to just submit with random user ids and lists so i need to encode it with some sort of obfuscation, but also with a checksum or something that would prevent tampering or at least let me know.
Anyone have any experience with this or ideas? ideally, i'd like to use something readily available in PHP (and also perl if possible since the encrypting part will happen in perl, but presumably i could port easily enough). maybe like generate a url string, such as "user_id=x&list=y", base64 encode it (which also shrinks it and is a plus) and then add a crc byte on the end? then my url would be http://www.example.com/file.php?hash="gobbledygook"
does anyone know of something in PHP that would do this? if not any suggestions for rolling your own (like algorithms, i don't need actual code probably unless you either have it, know of it on a free site, or really feel like writing it ;-) ) maybe using compression utils with a password? that would i think require recompiling php or using external programs which is doable, but not as desireable. plus if someone guessed the password, they could decrypt, but i suppose that is true for any algorithm that's one way. perhaps using ssl or pgp somehow? having 2 keys, then no one could decrypt it without the private key? that might be overkill. or mhash for hashing, but then might that be easy to crack and can it be computed in perl?
xposted to php-dev
Source: http://www.livejournal.com/community/php/360630.html
-
obfuscation and encoding
Date: 10/29/05
(PHP Development) Keywords: php, security, web
i have a case where i'm trying to provide some unsubscribe functionality via a link to a website in an email. i need to encode some information in the url, specifically a user id and a list so i know who they are and which list they are unsubscribing to. Security is of course important, I don't want anyone to be able to just submit with random user ids and lists so i need to encode it with some sort of obfuscation, but also with a checksum or something that would prevent tampering or at least let me know.
Anyone have any experience with this or ideas? ideally, i'd like to use something readily available in PHP (and also perl if possible since the encrypting part will happen in perl, but presumably i could port easily enough). maybe like generate a url string, such as "user_id=x&list=y", base64 encode it (which also shrinks it and is a plus) and then add a crc byte on the end? then my url would be http://www.example.com/file.php?hash="gobbledygook"
does anyone know of something in PHP that would do this? if not any suggestions for rolling your own (like algorithms, i don't need actual code probably unless you either have it, know of it on a free site, or really feel like writing it ;-) ) maybe using compression utils with a password? that would i think require recompiling php or using external programs which is doable, but not as desireable. plus if someone guessed the password, they could decrypt, but i suppose that is true for any algorithm that's one way. perhaps using ssl or pgp somehow? having 2 keys, then no one could decrypt it without the private key? that might be overkill. or mhash for hashing, but then might that be easy to crack and can it be computed in perl?
xposted to php
Source: http://www.livejournal.com/community/php_dev/61842.html
-
Dreamweaver...PHP..MYSQL...LJ ICONS
Date: 10/29/05
(WebDesign) Keywords: php, mysql, database, sql
I want to enter in the locations of each of the LJ Icons I make in a MYSQL database...then have them displayed in rows using PHP....and just a note...I have Dreamweaver MX 2004 but can only get them going down in a column.
Any ideas?
Source: http://www.livejournal.com/community/webdesign/1005594.html
-
Executing code twice
Date: 10/30/05
(PHP Community) Keywords: cms, php, mysql, html, database, sql
I have come across a problem that is driving me mad. I have a php and MySQL CMS and I have a page that extracts the age content (html) out and plops it into the template file and all is sent back to the user. I have now come to the point when I would like to stop some php amongst the body html that is stored for each id in the database. The problem is how to have it recognised as php and then run.
So at the moment, I just extract the in from the database and copy it into a field: $body=$row['body'];
This is then in turn put in the template. I would however like to have this code run and then the result (so the html, plus whatever else has been generated in the middle) is then copied into a field ready for insertion into the template.
Does anyone know of a way to do this? I have seen ways that are meant to have worked, but as yet have not, but I don’t want to note them down as they may cloud people’s ideas.
Thanks for any help.
Source: http://www.livejournal.com/community/php/360920.html
-
lend a hand with regular expressions?
Date: 10/30/05
(PHP Community) Keywords: php, google
I've been fiddling with regular expressions and, well, I'm not that great at getting things the right way around so I figured one of you guys/gals would be able to lend a hand. I need a regular expression to check against user-submitted comments, so it needs to allow letters, numbers and punctuation.
I did a google search for examples but all I can find is "email validation" ones.. apparently users only ever submit e-mail addresses through forms ;)
If you could direct me to a decent resource (not php.net), that'd help too. All help appreciated!
Source: http://www.livejournal.com/community/php/361133.html
-
EssentialPIM
Date: 10/31/05
(IT Professionals) Keywords: php
http://www.essentialpim.com/index.php
Today the makers of EssentialPIM are giving away PRO licenses. I picked the portable one because it can be stored on a USB thumb drive. So cool. You'll get the license within 48 hours.
Source: http://www.livejournal.com/community/itprofessionals/29144.html
|