laide234
Members-
Posts
33 -
Joined
-
Last visited
Never
Contact Methods
-
Website URL
http://www.olaide.com
Profile Information
-
Gender
Male
laide234's Achievements
Member (2/5)
0
Reputation
-
Here's another sample... might help [code] <?php switch ($page) { case 'submit' : $content = 'submit.php'; break; case 'contact' : $content = 'contact.php'; break; case 'faq' : $content = 'faq.php'; break; default : $content = 'submit.php'; } ?> <head></head> <title></title> <body <table> <tr> <td> <?php require_once 'header.php'; ?> </td> </tr> <tr> <td> <?php require_once $content; ?> </td> </tr> <tr> <td> <?php require_once 'footer.php'; ?> </td> </tr> [/code]
-
**solved** How do I put a variable into a header?
laide234 replied to laide234's topic in PHP Coding Help
Thanks Jenk. -
I have a variable $job_id that contains a numeric value I would like to append to a header. i.e. if $job_id = 5 go to listing.php?view=thanks&job_id=5 Here is what I tried [code]header('Location: listing.php?view=thanks&job_id='echo $job_id;'');[/code] Apperently, this isnt working. Any suggestions?
-
Genius. That did the trick. Thanks a bunch. ;D
-
This might be of some help... http://www.nstoia.com/toh/technical/imageresize/index.php
-
You have 3 if statements back to back.... [code] if (empty($_POST['user'])) && {empty($_POST['pass'])) { echo "Please insert your username"; echo "Please insert your password"; } if (empty($_POST['user'])) { echo "Please insert your username"; } if (empty($_POST['pass'])) { echo "Please insert your username"; }[/code] I dont think you can do that. use if... esle if... esle...
-
Here is the code... [code] <form action="processApp.php?action=apply" method="post" enctype="multipart/form-data" name="apply" id="apply"> <tr> <td><div align="right"><strong>*Applicant's Name: </strong></div></td> <td><input name="name" id="name" type="text" size="40" maxlength="30"></td> </tr> <tr> <td><div align="right"><strong>*Applicant's Email Address: </strong></div></td> <td><input name="email" id="email" type="text" size="40" maxlength="30"></td> </tr> <tr> <td colspan="2"><hr width="350"></td> </tr> <tr> <td><div align="right"><strong>Work Phone: </strong></div></td> <td><input name="wPhone" id="wPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td><div align="right"><strong>Home Phone: </strong></div></td> <td><input name="hPhone" id="hPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td><div align="right"><strong>Cell Phone: </strong></div></td> <td><input name="cPhone" id="cPhone" type="text" size="40" maxlength="20"></td> </tr> <tr> <td colspan="2"><hr width="350"></td> </tr> <tr> <td><div align="right"><strong>Paste your resume and/or cover letter here</strong></div></td> <td rowspan="2"><textarea name="resume" id="resume" cols="36" rows="10"></textarea></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> <td><input name="submitApp" id="submitApp" type="image" onClick="validateApply();" src="..//images/submit_app_button.gif" width="120" height="20" border="1"></td> </tr> </form>[/code] When I click on the image, it submits. I was going to add some form validation (and a submit(); )to "validateApply();" , but data is being sent with or without the submit. I even put a simple alert() in validateApply(), just to test it. But I get the alert, and then data is sent. I want to be able to control this with validation and a submit(). I do not want to access processApp.php until I am sure there is data in the fields. What am I missing???
-
*solved* PHP Variable passing (I should be embarrassed)
laide234 replied to laide234's topic in PHP Coding Help
::) Man! I am such a noob.... "(probably simple answer)" I would have never guessed that I didnt need to pass anything. Thank a mill', wildteen88. -
Please take a look at my code below. I would like to pass the variable in $autoNum to whichever of the php pages are loaded (edit, add or delete). autoNum is the primary key [code]<?php switch ($view) { case 'edit' : $content = 'edit.php'; break; case 'add' : $content = 'add.php'; break; case 'delete' : $content = 'delete.php'; break; default : $content = 'edit.php'; } ?> <td width="50%" colspan="2"> <?php echo $autoNum; require_once $content; ?>[/code] How do I send $autoNum to the requested page. :-[
-
Thanks Corona4456. That worked.
-
mysql_select_db(); best practice. your thoughts?
laide234 replied to micah1701's topic in PHP Coding Help
I use a config file, especially when I have mutiple pages accessing the same database. Connecting on every page can be a hassle. I just include the config file. -
I am calling a function in a .js file from a php file. I am pretty sure I am calling my .js file correctly, using [code]<sc**pt language="JavaScript" type="text/javascript" src="../library/job.js"></sc**pt>[/code] and [code]<input name="btnAddJob" type="button" id="btnAddJob" value="List Job" onClick="listJob();" class="box">[/code] However, within my .js file, this function works: function listJob() { window.location.href = 'index.php?view=add'; } But when I modify it to a simple submit, it doesnt work. function listJob() { submit(); } The above code will not respond (I am trying to submit the contents of a form.. I intend on adding some validation before submitting). Again, I am calling the file correctly... It just stops working when I change "window.location.href = 'index.php?view=add';" to "submit();" I would like to know why this is happening.
-
Thanks a bunch, akitchin. Adding the error_reporting() thing to my code suppressed this notice (I just learnt about notices and errors ::)) [code]// Report all errors except E_NOTICE // This is the default value set in php.ini error_reporting(E_ALL ^ E_NOTICE);[/code] Still trying to clean up the code so I dont get any notices, but this will more than do for now. Thanks again!
-
Anyone?
-
When I tried $name = $value[$id]['name']; I got multiple errors, all reading: Notice: Undefined index: 966 in /admin/product/modify.php on line 45