Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. That is correct, but it'll only work if your link is like this: mysite.com/page.php?delete=1 Then you access the delete variable using $_GET['delete'] However if you want to use the get variable in another page, that doesnt send the delete variable through the url you'll need to use a session or a cookie to store the delete variable.
  2. If your friend has coded the site in PHP. Then you'll want to find the PHP file or code that creates the header. Most probably in a file called header.php or something. or if your friend uses a PHP script that s/he has installed then you'll want to login to the admin control panel or find the config file to change the header. But to add Html into a php file use echo: [code=php:0]echo "<h1>My Site heading";[/code] make sure echo is between <?php and  ?>, you just add your html outside of the <?php ?> tags, eg: [code]<h1>My Site heading</h1> <?php // my php ?> more html[/code]
  3. Prehaps use this: [code=php:0]echo '<a href="' . $_SERVER['PHP_SELF'] . '?delete=1&idnum=' . $_SESSION['idnum'] . '">delete</a>';[/code] To get the delete and idnum variables fromo the URL you use $_GET['delete'] and $_GET['idnum'] instead of $delete and $idnum. You might want to look into the superglobal arrays over at php.net. You use the supergloabl arrays when register_global is off (and when its on). The superglobals are _POST, _GET, _COOKIE, _SESSION, _SERVER etc. You can learn more about supergloabls [url=http://uk2.php.net/manual/en/language.variables.predefined.php]here[/url]
  4. I would not recommend you to do that, as it is basically lazy programming. Yes when ever you want to access a session var you will need to use $_SESSION['var_name']. Why do you want to use $var_name to access your session variables? What you could do is extract the session variables from the session array using extract function, eg: [code=php:0]extract($_SESSION);[/code] Then you can use $var_name to access your var_name session. However this to me is lazy programming. However you'll still need to use $_SESSION['var_name'] to create the var_name session and to change the value of the session. You can only use extract when you want to retrieve the session vars.
  5. Umm hes asking for which version (distro) of linux to use to setup his Apache server on. That what question was, aswell as asking which version of Apache I think.
  6. If the mysqli extension works then the mysql extension should too. They both use the same mysql library (libmysql.dll). Very strange. Is the mysql extension you have the same versions as the version of PHP you are using?
  7. Use header redirect instead: [code=php:0]header("Refresh: 3; URL=index.php"); echo "The file " . basename( $_FILES['uploadedfile']['name']) . " has been uploaded";[/code] instead of [code=php:0]echo "The file " . basename( $_FILES['uploadedfile']['name']) . " has been uploaded"; sleep(3); // wait 3 seconds and then redirect header ('Location: index.php');[/code] That will redirect the user back to index.php after three secounds has passed.
  8. No, you must restart the server (not the hardware, but the software - eg (Apache, IIS or whate ever your server software is) in order for the new settings to be vailable. If you have Apache or IIS it just restart the service.
  9. If you are planning on using PHP with Apache. Installed Apache 2.0.x. Apache 2.2.x although is better, php is as of yet not compatible with Apache 2.2.x. However you can if you download third party PHP modules for Apache2.2.x. Or download the lates CVS versions of PHP.
  10. Did you restart the server when you changed those settings that was described in the warning.
  11. You could do it in CSS. I've seen some menus like that in CSS (only). However javascript is good. But I'm sure your many years of expertise in HTML, CSS and Javscript and what not you can come up with something *hint hint*
  12. Its not the header graphic that takes up the room. Its mainly the bit underneath it. Where it displays your avatar and links to recent posts etc. If the header is bugging you click the minus button to the right of the date. it'll hide all that stuff and just show the header graphic and menu links. Its what I do
  13. Rather than creating a PNG, maybe your browser doesnt support PNG. try a jpeg image instead so use: [code=php:0] // example1.php // set the HTTP header type to JPEG header("Content-type: image/jpeg"); // set the width and height of the new image in pixels $width = 350; $height = 360; // create a pointer to a new true colour image $im = ImageCreateTrueColor($width, $height); // sets background to red $red = ImageColorAllocate($im, 255, 0, 0); ImageFillToBorder($im, 0, 0, $red, $red); // send the new GIF image to the browser Imagejpeg($im); // destroy the reference pointer to the image in memory to free up resources ImageDestroy($im);[/code] Goto example.php you should get a red box. Also what does this return: [code]<?php echo '<pre>' . print_r(gd_info(), true) . '</pre>'; ?>[/code] Also what OS is your server running on, *nix (linux, unix, mac) or Windows?
  14. Umm, your post hasnt been deleted. Its where you created it which is in the PHPFreaks.com Questions, Comments, & Suggestions forum. Also work is being carried out. This prpbelm will not be fixed straight away the whole site is having a complete make over. This is the Website Critique forum. Not the PHPFreaks.com Questions, Comments, & Suggestions forum (where you posted your thread). Link to your thread below: http://www.phpfreaks.com/forums/index.php/topic,106824.0.html
  15. Prehaps you can use $_SERVER['REQUEST_URI'] $_SERVER['HTTP_REFERER'] and $_SERVER['REQUEST_URI'] is the only variables which store where the user can from, or for the file the user has requested respectively.
  16. To get where the user intended to go use $_SERVER['HTTP_REFERER'].
  17. Try this: [code]if (isset($_POST['NOTES'])) {   /*foreach ($_POST['NOTES'] as $value) {     echo "$value \n";*/     // show what ever is in the NOTES array     echo '<pre>' . print_r($_POST['NOTES'], true) . '</pre>'; }[/code] What does that return? It should return the format and what is in the NOTES array.
  18. Make sure there are no other existing libmysql.dll files in either the WINNT or WINNT/SYSTEM32 folder. If you dont have a WINNT folder look for a WINDOWS folder. Also make sure PHP is using the correct php.ini too, by running the phpinfo() function in a script. Also make sure you have restarted IIS too when changing the php.ini file. And have you restarted your computer when you added PHP to the PATH.
  19. Looks like you have a password set for the root user. add the -p command at the end of the command mysql> mysql -u root -p No hit enter. MySQL will promt for a password. Enter the password in after hit enter. If its correct it'll log you in and show the MySQL Command Line.
  20. oldmanice please awnser the questions in full, dont post one or on or two word answers. PLease post at least a couple of sentenses or so. Not all versions of linux is free. There are couple of distros you ahve to pay a lincense for.
  21. Well ideally any table should have an auto incrementing column, which will be the primary key. Howev i was pressed for time when I was posting, so I just rushed the post abit.
  22. The code provided isnt the correct code AFAIK to create image with gd. Prehaps a have read of [url=http://www.design-ireland.net/graphics/imagery-15.php]this[/url] tutorial. That tutorial shows you how to create basics shapes with PHP GD.
  23. Or you can force a redirect using: header("Refresh: 30; URL=path-to-file.php"); However you'll have to make sure there is no html output before you use this function.
  24. Use this as the query: SELECT * FROM users_table ORDER BY user_id_column DESC LIMIT 1 Should select the last row from the database
  25. Are you getting an error? What happens if you add this: [code]$row = mysql_fetch_assoc($result_group); echo '<p><pre>' . print_r($row, true) . '</pre><p>';[/code] After echo $query;
×
×
  • 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.