Jump to content

spasme

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

About spasme

  • Birthday 11/28/1984

Contact Methods

  • Website URL
    http://wedesign.ro
  • Yahoo
    spasmele

Profile Information

  • Gender
    Male
  • Location
    Bucharest, Romania

spasme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello agian guys. I have this URL: domain.ro/ceasuri.php?brand=fossil&offset=0&curea=piele&model=barbatesc I turned it into: domain.ro/ceasuri-fossil-0-piele-barbatesc Using: Options +FollowSymLinks RewriteEngine on RewriteRule ceasuri-(.*)-(.*)-(.*)-(.*) ceasuri.php?brand=$1&offset=$2&curea=$3&model=$4 The thing is that i need the mod_write to work for domain.ro/ceasuri-fossil domain.ro/ceasuri-fossil-0 domain.ro/ceasuri-fossil-0-piele domain.ro/ceasuri-fossil-piele-barbatesc-all ... also. How do i do that ?! Thanks in advance.
  2. OK, don't do that. I'm not so good with security. It was just an example. @Mchl -- an example would probably be most welcomed.
  3. Ok, if you insist on doing this yourself... This part is about designing you DataBase. You'll want to have a table for your users and the corresponding details and a table to store your file's information. Each user shlould have and unique ID field (auto increment or auto generated) or something. The file's table should have an "owner" and "approved" field so you can keep track of your stuff... So... when a user Posts/Uploads a file, it's name and details go intro the files table along with the owner ID. You will probably be using a form to let your users post the files. You can include a hidden fiend with name="approved" and value="no" and one with the name="owner" value="username" (use SESSION to get username) The idea behind this is that once the user submits the form the file will automatically be marked in your file's table as waiting to be approved . To view the pending files you would then simply (pending.php) SELECT * FROM `files` WHERE approved='no' ... (COUNT,GROUP...) whatever else you need to sort Whis will then echo out all the files pending approval. Once you have them echoed you cand simply echo a link next to each filename with actions (Edit, Delete, ..., Approve) these links might look somenthing like this: <a href="actions.php?action=approve&id=$sql[id]">Approve</a> In actions.php you simply use a CASE function based on the action variable in the URL and execute SQL stuff based on that. After approving a file you could redirect yourself back to the pending.php and so on ... Hope this helps (and makes sense). I can give you an example of an actions.php i from one of my latest projects. Cheers
  4. I use Dreamweaver for basic HTML, tables, layouts, forms and CSS. I think its great for these because of the Design/Split view mode. For PHP and others I use Zend. I only descovered Zend Studio a few months ago and i'm pleased to say that it's made the PHP coding alot easier. I've also been playing around with Zend Guard and Zend Optimizer... great products. I've recently, based on your posts, tryed Eclipse. It's also a great product. I'm amazed its free I'm can't point out why but I still prefer tu use Zend for PHP coding.
  5. You'll have alot of work cut out for you ... If you're just starting with PHP i'd sugest using a ready made CMS or something. From my experience using Joomla with certain modules (DOCman) would cover most of the features you need. Their free and easy to install and understand. From what i remenber it does have a pending queue of files waiting to be approved. Google it and see if it has all the features you'll be needing. In my oppinion it might pe easier to customize the modules you suite your needs than to start from stratch. Cheers. (hope this isn't considered advertising)
  6. sure! $message .= "Age: $age\n"; or keep the next line inticator separate to have a cleaner code: $message .= "\n"; \n is equivalent to br (just so you know) Happy Coding! LE: I'd really advise to take a look at the script i attached in the earlyer post... it will explane allot
  7. include this $message .= $age."\n"; $message .= $message."\n";
  8. In theory this is all very easy with PHP and $_GET but keep in mind that some Firewalls, Antivirusez, Internet Security software might interpret this as a sort of attack or takeover. I mean telling some setup.exe to open the browser and acces some http. If this is not a problem for you use something like: http://example.com/tracking.php?code=XXXXXXX tracking.php should look something like this: <?PHP $code = $_GET[code]; mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database"); @mysql_select_db("$DBName") or die("Unable to select database $DBName"); $sqlquery = "INSERT INTO code_table VALUES('field1', 'field2', ... , '$code')"; echo "Some message..."; ?> Once again if you don't want so exploit the user's browser you might want to look into some PEARL or other stuff (i'm no expert) [/code]
  9. id would help to see the error and the whole code. first off, can you echo $_session['username']; ?
  10. <?php if ($_POST['submit']==true) //if "email" is filled out, send email { //send email $email = $_POST['email'] ; $subject = "Job Application" ; $firstname = $_POST['firstname'] ; $lastname = $_POST['lastname'] ; $email = $_POST['email'] ; $age = $_POST['age'] ; $reason = $_POST['reason'] ; $timezone = $_POST['timezone'] ; $times = $_POST['times'] ; $to = "[email protected]"; $subject = $subject; $message .="\n"; $message .= $firstname."\n"; $message .= $lastname."\n"; $message .= $email."\n"; $message .= $reason."\n"; $message .= $timezone."\n"; $message .= $times."\n"; $headers ='From: [email protected]' . "\r\n" . 'Reply-To: [email protected]' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); echo "Thank you for applying!, please allow upto 24 hours for reply!"; } else //if "email" is not filled out, display the form { echo "<form method='post' action=''djapp.php'> First Name: <input name='firstname' type='text' /><br /> Last Name: <input name='lastname' type='text' /><br /> Email: <input name='email' type='text' /><br /> Age: <input name='age' type='text' /><br /> Time Zone: <input name='timezone' type='text' /><br /> Times Can DJ: <input name='times' type='text' /><br /> Reason for applying:<br /> <textarea name='message' rows='10' cols='40' /> </textarea><br /> <input type='hidden' name='submit' value='true' /> <input type='submit' value='Submit' /> </form>"; } ?> I've tested it on my server and it works fine. HERE You needed to have a form (hidden value) that let the form know when to start sending...
  11. Maybe this will help: <? $ok = array(); array_push($ok, "value1"); foreach($ok as $value) { array_push($ok, "value2"); } print_r($ok); // this prints the whole array echo "<br>"; echo $ok[1]; // arrays start from [0] so the 2nd value si called using [1] and so on echo "<br>"; ?>
  12. ok, so you need to delete the entire row... can you echo $value and $bf_record?
  13. $headers should look somethink like this: $headers="From: ".$yourname." <".$youremail.">\n"; $headers.="Reply-To: ".$yourname." <".$youremail.">\n"; $headers.="MIME-Version: 1.0\n"; $headers.="Content-Type: multipart/mixed; boundary=\"".$boundary."\"\n"; $headers.="X-Sender: ".$_SERVER['REMOTE_ADDR']."\n"; $headers.="X-Mailer: PHP/".phpversion()."\n"; $headers.="X-Priority: ".$priority."\n"; $headers.="Return-Path: <".$youremail.">\n"; $headers.="This is a multi-part message in MIME format.\n";
  14. I'm not sure i understood exactly what you need done... If you use mysql_query("DELETE FROM ...") -- this DELETES the entire row. If you need to set certain fields in your table as blank or something use something like this: $result = mysql_query("UPDATE issues SET field_name='$variable' WHERE id='$id' ") or die ("Could not read data because ".mysql_error()); or an other idea: try usgin $value = $_GET[value] or $value = $_POST[value] dependin on how the value is read, from a post or URL same goes for $bf_record Cheers
  15. try using $_POST instead of $_REQUEST i've attached an interesting email/form script maybe it will be of some kind of help. Let me know if you have any questions about it Cheers. [attachment deleted by admin]
×
×
  • 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.