Jump to content

PWD

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

PWD's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You could store the info in a session variable. That way you would only need to use the following to recall those values on ANY page: <?php echo $_SESSION['Data1']; ?>
  2. I ran into the same thing while developing a website for a client then parked it at Yahoo! webhosting. They also had Register Globals set to ON....Made me cringe, but I was able to still initialize sessions and keep pretty secure code... Unfortunately, no way to turn Register Globals to OFF w/o access to php.ini file. When I contacted Yahoo! they stated they had NO plans of adjusting so I had to dig deep and use define() more...
  3. Windows Firewall probanly has port 3306 blocked. Do you have SP2 installed? If so, go to Start => Settings => Control Panel => Windows Firewall. Select the option, "Off" to completely disable the firewall and then try to reconnect to MySQL. If you can connect, you'll have to create an exception in Windows Firewall to run both...
  4. Maybe I missed something basic, but do I need to set anything special in my php.ini to upload a file from our webserver to our file server across the network? I have given the anonymous web user account write access to the folder, mapped the network drive and have the following in my script: [code] $filedestination = 'Z:/www/folder1/'; /* The 'Z:/' drive being my network drive */[/code] Running the following: 1) php 4.4.2 2) Windows 2000 Server
  5. [b]KENRBNSN:[/b] When I put the include() into the foreach() loop, it gives me 3 pages; one right on top of another... [b]SANFLY: [/b] Exactly the brain storm I was looking for.... Always grateful to the both of you....
  6. You can also do it at your query level as well: [code]$query= "Select DATE_FORMAT(date_date,'%M %D %Y') AS sortdate from your_table ORDER BY date_date ASC"; /* ORDER BY function orders ascending (ASC) or descending(DESC) */ echo $sortdate; [/code] Also, search the MySQL site for the different formats you can use for DATE_FORMAT()...
  7. PWD

    HELP

    Do you have some code we can look at?
  8. Have you tried doing a chmod() to your upload script? Something tells me directory Acess Control Lists may have changed on your host's server...
  9. I've written the following multiple file upload script which works flawlessly: [code]if(!empty($_POST['go'])) { foreach($_FILES['fileup']['error'] as $key => $error) {   if($error == UPLOAD_ERR_OK) {     $filename = $_FILES['fileup']['name'][$key];     $filetmp = $_FILES['fileup']['tmp_name'][$key];     $filetype = $_FILES['fileup']['type'][$key];     $filesize = $_FILES['fileup']['size'][$key];     $filedest = 'uploads/';   if($filetype == 'image/jpeg') {         move_uploaded_file($filetmp, $filedest . $filename);   } } } include 'success.php'; } else {   echo print_r($_FILES); }  [/code] [b]My Problem:[/b] My 'success.php' page is suppose to list a confirmation for each image uploaded, yet as it stands, it will ONLY display the last image's information. Yet all 3 images upload fine. I assume I'll have to put all the information into an array?!? Here is 'success.php': [code] <p>     Here is a recap of the photos you uploaded: </p> <ul class="none">     <li>Image Name: <?php echo $filename; ?></li>     <li>Image Type: <?php echo $filetype; ?></li>     <li>Image Size: <?php echo $filesize; ?> bytes</li> </ul> [/code] My gratitude ahead of time for helping me learn...
  10. I think I missed something in MySQL 101 years ago, or maybe a new thing with MySQL 5.0.15, but my simple insert statement from a textfield error out [b]ONLY[/b] when an apostrophe is used within the text field: [code]<!-- Textfield Text example --> We went down to Michael's house <!-- End Textfield entry -->[/code] [code]MySQL Statement: $query = "INSERT into TABLE(text_field) VALUES('$_POST[textfield]')";[/code] What do I need to include in my INSERT statement to allow apostrophes? addslashes()? My gratitude ahead of time....
  11. Are you looking to pass form variables or session information? Do you have a snippet of code for us to look at? If you're looking to pass session information between the two protocols, you'll need to pass your session information in your URL: [code]$sid = session_name() . '=' . session_id(); <a href="https://somepage.php?<?=$sid?>">My Page</a>[/code] This works from http to https and https to http. From a security standpoint, not generally a good idea to expose your session ID in the URL, but this is the only way I have personally found to do it in the websites I've coded.
  12. It is formatted as a DATE
  13. date_date is the literal name of the column. I did try your suggestion to no avail. I also tried to completely remove the alias (AS date_date...) to no avail... Still searching
  14. What is the best way to format my MySQL query if I want to display my [b]dates[/b] in ascending order? Currently, as written, my query sorts my dates [b]alphabetically[/b], and I want it sorted numerically: [code]$query = "SELECT DATE_FORMAT(date_date,'%M %D %Y') AS date_date,date_info from imp_dates ORDER BY date_date ASC";[/code] My search of the MySQL website must not be correct as I'm not producing any results about this. My gratitude ahead of time for your help...
  15. Just place it before your while() loop: [code]<?php include 'library/config.php'; include 'library/opendb.php'; $id = $_GET['id']; if ($id == "") { $rowsPerPage = 6; $pageNum = 1; if(isset($_GET['page'])) {     $pageNum = $_GET['page']; } $offset = ($pageNum - 1) * $rowsPerPage; $query = "SELECT id, name, path, title, thumbnail, playcount, DATE_FORMAT(entry_date, '%M %D %Y') FROM upload2 ORDER BY id DESC LIMIT $offset, $rowsPerPage"; $result = mysql_query($query) or die('Error, query failed'); ?> <div class="title">Videos</div> <?php while($row = mysql_fetch_array($result)) { ?> /*Your Other HTML Markup for your loop*/ /*Then close your loop*/ <?php } ?> [/code]
×
×
  • 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.